def normalize_path(path, resolve_symlinks=True):<EOL>
path = expanduser(path)<EOL>if resolve_symlinks:<EOL><INDENT>path = os.path.realpath(path)<EOL><DEDENT>else:<EOL><INDENT>path = os.path.abspath(path)<EOL><DEDENT>return os.path.normcase(path)<EOL>
Convert a path to its canonical, case-normalized, absolute version.