#NEWLINE# def enumerate_import_methods( tokens ) : #NEWLINE# #INDENT# '\n    Returns a list of imported module methods (such as re.compile) inside\n    *tokens*.\n    ' #NEWLINE# global_imports = enumerate_global_imports ( tokens ) #NEWLINE# out = [ ] #NEWLINE# for item in global_imports : #NEWLINE# #INDENT# for ( index , tok ) in enumerate ( tokens ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# next_tok = tokens [ ( index + 1 ) ] #NEWLINE# try : #NEWLINE# #INDENT# next_next_tok = tokens [ ( index + 2 ) ] #NEWLINE# #UNINDENT# except IndexError : #NEWLINE# #INDENT# next_next_tok = ( 54 , '\n' , ( 1 , 1 ) , ( 1 , 2 ) , '#\n' ) #NEWLINE# #UNINDENT# #UNINDENT# except IndexError : #NEWLINE# #INDENT# next_tok = ( 54 , '\n' , ( 1 , 1 ) , ( 1 , 2 ) , '#\n' ) #NEWLINE# #UNINDENT# token_type = tok [ 0 ] #NEWLINE# token_string = tok [ 1 ] #NEWLINE# if ( token_string == item ) : #NEWLINE# #INDENT# if ( next_tok [ 1 ] == '.' ) : #NEWLINE# #INDENT# module_method = ( '%s.%s' % ( token_string , next_next_tok [ 1 ] ) ) #NEWLINE# if ( module_method not in out ) : #NEWLINE# #INDENT# out . append ( module_method ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# return out