from typing import OrderedDict


def package_dependency_tree(dependency):
    """Returns a dependency tree for a single package
    :param dependency: Requirement or Package
    :return: Dependency tree for the specified package or requirement
    """
    return OrderedDict(sorted({
        requirement: package_dependency_tree(dependency=requirement)
        for requirement in dependency.requirements
    }.items()))