def get_path(filename):
    """
    Get absolute path for filename.

    :param filename: file
    :return: path
    """
    path = abspath(filename) if os.path.isdir(filename) else dirname(abspath(filename))
    return path
Get absolute path for filename.

    :param filename: file
    :return: path