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

Function new_context

tools/inspector_protocol/jinja2/runtime.py:59–77  ·  view source on GitHub ↗

Internal helper to for context creation.

(environment, template_name, blocks, vars=None,
                shared=None, globals=None, locals=None)

Source from the content-addressed store, hash-verified

57
58
59def new_context(environment, template_name, blocks, vars=None,
60 shared=None, globals=None, locals=None):
61 """Internal helper to for context creation."""
62 if vars is None:
63 vars = {}
64 if shared:
65 parent = vars
66 else:
67 parent = dict(globals or (), **vars)
68 if locals:
69 # if the parent is shared a copy should be created because
70 # we don't want to modify the dict passed
71 if shared:
72 parent = dict(parent)
73 for key, value in iteritems(locals):
74 if value is not missing:
75 parent[key] = value
76 return environment.context_class(environment, parent, template_name,
77 blocks)
78
79
80class TemplateReference(object):

Callers 2

new_contextMethod · 0.90
derivedMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…