#NEWLINE# def get_required_dists( dists , dist ) : #NEWLINE# #INDENT# 'Recursively generate a list of distributions from *dists* that are\n    required by *dist*.\n\n    :param dists: a list of distributions\n    :param dist: a distribution, member of *dists* for which we are interested\n    ' #NEWLINE# if ( dist not in dists ) : #NEWLINE# #INDENT# raise DistlibException ( ( 'given distribution %r is not a member of the list' % dist . name ) ) #NEWLINE# #UNINDENT# graph = make_graph ( dists ) #NEWLINE# req = [ ] #NEWLINE# todo = graph . adjacency_list [ dist ] #NEWLINE# while todo : #NEWLINE# #INDENT# d = todo . pop ( ) [ 0 ] #NEWLINE# req . append ( d ) #NEWLINE# for pred in graph . adjacency_list [ d ] : #NEWLINE# #INDENT# if ( pred not in req ) : #NEWLINE# #INDENT# todo . append ( pred ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return req