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

Method format_string

tools/inspector_protocol/jinja2/sandbox.py:405–415  ·  view source on GitHub ↗

If a format call is detected, then this is routed through this method so that our safety sandbox can be used for it.

(self, s, args, kwargs)

Source from the content-addressed store, hash-verified

403 ), name=attribute, obj=obj, exc=SecurityError)
404
405 def format_string(self, s, args, kwargs):
406 """If a format call is detected, then this is routed through this
407 method so that our safety sandbox can be used for it.
408 """
409 if isinstance(s, Markup):
410 formatter = SandboxedEscapeFormatter(self, s.escape)
411 else:
412 formatter = SandboxedFormatter(self)
413 kwargs = _MagicFormatMapping(args, kwargs)
414 rv = formatter.vformat(s, args, kwargs)
415 return type(s)(rv)
416
417 def call(__self, __context, __obj, *args, **kwargs):
418 """Call an object from sandboxed code."""

Callers 1

callMethod · 0.45

Calls 4

_MagicFormatMappingClass · 0.85
SandboxedFormatterClass · 0.70
typeFunction · 0.50

Tested by

no test coverage detected