def _get_imported_module(self, module_name):
<EOL>imp_mod = self.by_name.get(module_name)<EOL>if imp_mod:<EOL><INDENT>return imp_mod<EOL><DEDENT>no_obj = module_name.rsplit('<STR_LIT:.>', <NUM_LIT:1>)[<NUM_LIT:0>]<EOL>imp_mod2 = self.by_name.get(no_obj)<EOL>if imp_mod2:<EOL><INDENT>return imp_mod2<EOL><DEDENT>if module_name in self.pkgs:<EOL><INDENT>pkg_name = module_name  + "<STR_LIT>"<EOL>return self.by_name[pkg_name]<EOL><DEDENT>if no_obj in self.pkgs:<EOL><INDENT>pkg_name = no_obj +  "<STR_LIT>"<EOL>return self.by_name[pkg_name]<EOL><DEDENT>
try to get imported module reference by its name