factor_agent.gate.vocabulary.resolve#
- resolve(path, roots=None)[source]#
Import the object at
path: the longest importable module prefix, then attributes.With
roots, the path may not leave the modules under them: no attribute hop may go through a module outside them (KunQuant.jit.cfake .subprocess.runis refused, though its prefix is KunQuant’s), and the object must be defined in one of them (its__module__), so a name an allowed module imported from elsewhere is refused too.- Raises:
- ImportError, AttributeError
If no prefix imports or an attribute is missing; the
ImportErrorsubclass_OutsideModulesif the path leavesroots.