def get_required_dists(dists, dist):
    if dist not in dists:
        raise DistlibException('given distribution %r is not a member '
                               'of the list' % dist.name)
    graph = make_graph(dists)

    req = []  # required distributions
    todo = graph.adjacency_list[dist]  # list of nodes we should inspect

    while todo:
        d = todo.pop()[0]
        req.append(d)
        for pred in graph.adjacency_list[d]:
            if pred not in req:
                todo.append(pred)

    return req
Recursively generate a list of distributions from *dists* that are
dataset/ETHPy150Open anzev/hedwig/build/pip/pip/_vendor/distlib/database.py/get_required_dists