def get_required_dists(dists, dist):
if dist not in dists:<EOL><INDENT>raise DistlibException('<STR_LIT>'<EOL>'<STR_LIT>' % dist.name)<EOL><DEDENT>graph = make_graph(dists)<EOL>req = []  <EOL>todo = graph.adjacency_list[dist]  <EOL>while todo:<EOL><INDENT>d = todo.pop()[<NUM_LIT:0>]<EOL>req.append(d)<EOL>for pred in graph.adjacency_list[d]:<EOL><INDENT>if pred not in req:<EOL><INDENT>todo.append(pred)<EOL><DEDENT><DEDENT><DEDENT>return req<EOL>
Recursively generate a list of distributions from *dists* that are
    required by *dist*.

    :param dists: a list of distributions
    :param dist: a distribution, member of *dists* for which we are interested