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

Function get_jinja_locals

tools/inspector_protocol/jinja2/debug.py:198–225  ·  view source on GitHub ↗
(real_locals)

Source from the content-addressed store, hash-verified

196
197
198def get_jinja_locals(real_locals):
199 ctx = real_locals.get('context')
200 if ctx:
201 locals = ctx.get_all().copy()
202 else:
203 locals = {}
204
205 local_overrides = {}
206
207 for name, value in iteritems(real_locals):
208 if not name.startswith('l_') or value is missing:
209 continue
210 try:
211 _, depth, name = name.split('_', 2)
212 depth = int(depth)
213 except ValueError:
214 continue
215 cur_depth = local_overrides.get(name, (-1,))[0]
216 if cur_depth < depth:
217 local_overrides[name] = (depth, value)
218
219 for name, (_, value) in iteritems(local_overrides):
220 if value is missing:
221 locals.pop(name, None)
222 else:
223 locals[name] = value
224
225 return locals
226
227
228def fake_exc_info(exc_info, filename, lineno):

Callers 1

fake_exc_infoFunction · 0.85

Calls 6

intFunction · 0.85
popMethod · 0.80
getMethod · 0.65
copyMethod · 0.65
get_allMethod · 0.45
splitMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…