def get_reverse_dependency_tree(package_name, depth=None, paths=None,<EOL>build_requires=False,<EOL>private_build_requires=False):
pkgs_list = [[package_name]]<EOL>g = digraph()<EOL>g.add_node(package_name)<EOL>it = iter_package_families(paths)<EOL>package_names = set(x.name for x in it)<EOL>if package_name not in package_names:<EOL><INDENT>raise PackageFamilyNotFoundError("<STR_LIT>" % package_name)<EOL><DEDENT>if depth == <NUM_LIT:0>:<EOL><INDENT>return pkgs_list, g<EOL><DEDENT>bar = ProgressBar("<STR_LIT>", len(package_names))<EOL>lookup = defaultdict(set)<EOL>for i, package_name_ in enumerate(package_names):<EOL><INDENT>it = iter_packages(name=package_name_, paths=paths)<EOL>packages = list(it)<EOL>if not packages:<EOL><INDENT>continue<EOL><DEDENT>pkg = max(packages, key=lambda x: x.version)<EOL>requires = []<EOL>for variant in pkg.iter_variants():<EOL><INDENT>pbr = (private_build_requires and pkg.name == package_name)<EOL>requires += variant.get_requires(<EOL>build_requires=build_requires,<EOL>private_build_requires=pbr<EOL>)<EOL><DEDENT>for req in requires:<EOL><INDENT>if not req.conflict:<EOL><INDENT>lookup[req.name].add(package_name_)<EOL><DEDENT><DEDENT>bar.next()<EOL><DEDENT>bar.finish()<EOL>n = <NUM_LIT:0><EOL>consumed = set([package_name])<EOL>working_set = set([package_name])<EOL>node_color = "<STR_LIT>"<EOL>node_fontsize = <NUM_LIT:10><EOL>node_attrs = [("<STR_LIT>", node_color),<EOL>("<STR_LIT>", "<STR_LIT>"),<EOL>("<STR_LIT>", node_fontsize)]<EOL>while working_set and (depth is None or n < depth):<EOL><INDENT>working_set_ = set()<EOL>for child in working_set:<EOL><INDENT>parents = lookup[child] - consumed<EOL>working_set_.update(parents)<EOL>consumed.update(parents)<EOL>for parent in parents:<EOL><INDENT>g.add_node(parent, attrs=node_attrs)<EOL>g.add_edge((parent, child))<EOL><DEDENT><DEDENT>if working_set_:<EOL><INDENT>pkgs_list.append(sorted(list(working_set_)))<EOL><DEDENT>working_set = working_set_<EOL>n += <NUM_LIT:1><EOL><DEDENT>return pkgs_list, g<EOL>
Find packages that depend on the given package.

    This is a reverse dependency lookup. A tree is constructed, showing what
    packages depend on the given package, with an optional depth limit. A
    resolve does not occur. Only the latest version of each package is used,
    and requirements from all variants of that package are used.

    Args:
        package_name (str): Name of the package depended on.
        depth (int): Tree depth limit, unlimited if None.
        paths (list of str): paths to search for packages, defaults to
            `config.packages_path`.
        build_requires (bool): If True, includes packages' build_requires.
        private_build_requires (bool): If True, include `package_name`'s
            private_build_requires.

    Returns:
        A 2-tuple:
        - (list of list of str): Lists of package names, where each list is a
          single depth in the tree. The first list is always [`package_name`].
        - `pygraph.digraph` object, where nodes are package names, and
          `package_name` is always the leaf node.