MCPcopy Index your code
hub / github.com/nodejs/node / load

Method load

tools/inspector_protocol/jinja2/loaders.py:466–481  ·  view source on GitHub ↗
(self, environment, name, globals=None)

Source from the content-addressed store, hash-verified

464
465 @internalcode
466 def load(self, environment, name, globals=None):
467 key = self.get_template_key(name)
468 module = '%s.%s' % (self.package_name, key)
469 mod = getattr(self.module, module, None)
470 if mod is None:
471 try:
472 mod = __import__(module, None, None, ['root'])
473 except ImportError:
474 raise TemplateNotFound(name)
475
476 # remove the entry from sys.modules, we only want the attribute
477 # on the module object we have stored on the loader.
478 sys.modules.pop(module, None)
479
480 return environment.template_class.from_module_dict(
481 environment, mod.__dict__, globals)

Callers

nothing calls this directly

Calls 4

get_template_keyMethod · 0.95
TemplateNotFoundClass · 0.90
popMethod · 0.80
from_module_dictMethod · 0.45

Tested by

no test coverage detected