def get_imports(project, pydefined):
 pymodule = pydefined.get_module()
 module = module_imports.ModuleImports(project, pymodule)
 if (pymodule == pydefined):
  return [stmt.import_info for stmt in module.imports]
 return module.get_used_imports(pydefined)

def get_imports ( project , pydefined ) : pymodule = pydefined . get_module ( ) module = module_imports . ModuleImports ( project , pymodule ) if ( pymodule == pydefined ) : return [ stmt . import_info for stmt in module . imports ] return module . get_used_imports ( pydefined )
a shortcut for getting the importinfos used in a scope .