<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def normpath(path):
 """Normalize given path in various different forms. '/etc/hosts' '/root/t' """

    funcs = [os.path.normpath, os.path.abspath]
    if "~" in path:
        funcs = [os.path.expanduser] + funcs

    return chaincalls(funcs, path)