Normalize a path.

    Expands ~'s, resolves relative paths, normalizes and returns
    an absolute path.

def normpath(path):
    """Normalize a path.

    Expands ~'s, resolves relative paths, normalizes and returns
    an absolute path.
    """
    return os.path.abspath(os.path.normpath(os.path.expanduser(path)))