def METHOD_NAME(self, fullname):
    if fullname not in self.modules:
        raise ImportError
    else:
        sys.modules[fullname] = self.modules[fullname]
        if fullname in self.module_code:
            try:
                self.module_code[fullname]()
            except Exception:
                del sys.modules[fullname]
                raise
        return self.modules[fullname]