def normpath(path):
funcs = [os.path.normpath, os.path.abspath]<EOL>if "<STR_LIT>" in path:<EOL><INDENT>funcs = [os.path.expanduser] + funcs<EOL><DEDENT>return chaincalls(funcs, path)<EOL>
Normalize given path in various different forms.

    >>> normpath("/tmp/../etc/hosts")
    '/etc/hosts'
    >>> normpath("~root/t")
    '/root/t'