#NEWLINE# def entry_gen( root_ns , module_name ) : #NEWLINE# #INDENT# q = [ root_ns ] #NEWLINE# seen = set ( ) #NEWLINE# while q : #NEWLINE# #INDENT# ns = q . pop ( ) #NEWLINE# for x in dir ( ns ) : #NEWLINE# #INDENT# cand = getattr ( ns , x ) #NEWLINE# if ( isinstance ( cand , types . ModuleType ) and ( cand . __name__ not in seen ) and cand . __name__ . startswith ( module_name ) ) : #NEWLINE# #INDENT# seen . add ( cand . __name__ ) #NEWLINE# q . insert ( 0 , cand ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( isinstance ( cand , ( types . MethodType , types . FunctionType ) ) and ( cand not in ns ) and cand . __doc__ ) : #NEWLINE# #INDENT# seen . add ( cand ) #NEWLINE# ( yield cand )