MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / import_prefix

Method import_prefix

lib/sqlalchemy/util/preloaded.py:130–143  ·  view source on GitHub ↗

Resolve all the modules in the registry that start with the specified path.

(self, path: str)

Source from the content-addressed store, hash-verified

128 return lambda fn: fn
129
130 def import_prefix(self, path: str) -> None:
131 """Resolve all the modules in the registry that start with the
132 specified path.
133 """
134 for module in self.module_registry:
135 if self.prefix:
136 key = module.split(self.prefix)[-1].replace(".", "_")
137 else:
138 key = module
139 if (
140 not path or module.startswith(path)
141 ) and key not in self.__dict__:
142 __import__(module, globals(), locals())
143 self.__dict__[key] = globals()[key] = sys.modules[module]
144
145
146_reg = _ModuleRegistry()

Callers 5

__goFunction · 0.80
__goFunction · 0.80
__init__.pyFile · 0.80
__goFunction · 0.80

Calls 4

localsFunction · 0.85
splitMethod · 0.80
replaceMethod · 0.45
startswithMethod · 0.45

Tested by 1