def get_module(self, name, node):
for mod in self.modules():<EOL><INDENT>mod_name = mod.node.name<EOL>if mod_name == name:<EOL><INDENT>return mod<EOL><DEDENT>package = node.root().name<EOL>if mod_name == "<STR_LIT>" % (package, name):<EOL><INDENT>return mod<EOL><DEDENT>if mod_name == "<STR_LIT>" % (package.rsplit("<STR_LIT:.>", <NUM_LIT:1>)[<NUM_LIT:0>], name):<EOL><INDENT>return mod<EOL><DEDENT><DEDENT>raise KeyError(name)<EOL>
return a module by its name, looking also for relative imports;
        raise KeyError if not found