def enumerate_local_modules(tokens, path):
<EOL>modules = enumerate_imports(tokens)<EOL>local_modules = []<EOL>parent = "<STR_LIT>"<EOL>for root, dirs, files in os.walk(path):<EOL><INDENT>if not parent:<EOL><INDENT>parent = os.path.split(root)[<NUM_LIT:1>]<EOL><DEDENT>for f in files:<EOL><INDENT>if f.endswith('<STR_LIT>'):<EOL><INDENT>f = f[:-<NUM_LIT:3>] <EOL>module_tree = root.split(parent)[<NUM_LIT:1>].replace('<STR_LIT:/>', '<STR_LIT:.>')<EOL>module_tree = module_tree.lstrip('<STR_LIT:.>')<EOL>if module_tree:<EOL><INDENT>module = "<STR_LIT>" % (module_tree, f)<EOL><DEDENT>else:<EOL><INDENT>module = f<EOL><DEDENT>if not module in modules:<EOL><INDENT>local_modules.append(module)<EOL><DEDENT><DEDENT><DEDENT><DEDENT>return local_modules<EOL>
Returns a list of modules inside *tokens* that are local to *path*.

**Note:**  Will recursively look inside *path* for said modules.