Change working directory.

    Returns absolute path to new working directory.

def cd(path):
    """
    Change working directory.

    Returns absolute path to new working directory.
    """
    _cdhist.append(pwd())  # Push to history.
    path = abspath(path)
    os.chdir(path)
    return path