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