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

Method from_string

tools/inspector_protocol/jinja2/environment.py:874–880  ·  view source on GitHub ↗

Load a template from a string. This parses the source given and returns a :class:`Template` object.

(self, source, globals=None, template_class=None)

Source from the content-addressed store, hash-verified

872 return self.select_template(template_name_or_list, parent, globals)
873
874 def from_string(self, source, globals=None, template_class=None):
875 """Load a template from a string. This parses the source given and
876 returns a :class:`Template` object.
877 """
878 globals = self.make_globals(globals)
879 cls = template_class or self.template_class
880 return cls.from_code(self, self.compile(source), globals, None)
881
882 def make_globals(self, d):
883 """Return a dict for the globals."""

Callers 2

compile_expressionMethod · 0.95
__new__Method · 0.45

Calls 3

make_globalsMethod · 0.95
compileMethod · 0.95
from_codeMethod · 0.45

Tested by

no test coverage detected