parameters: (self, s, args, kwargs, format_func=None)
return_statement: return type(s)(rv)
docstring: If a format call is detected, then this is routed through this
          method so that our safety sandbox can be used for it.
docstring_summary: If a format call is detected, then this is routed through this
          method so that our safety sandbox can be used for it.
docstring_tokens: If a format call is detected then this is routed through this method so that our safety sandbox can be used for it .
function: def format_string(self, s, args, kwargs, format_func=None):
          """If a format call is detected, then this is routed through this
          method so that our safety sandbox can be used for it.
          """
          if isinstance(s, Markup):
              formatter = SandboxedEscapeFormatter(self, s.escape)
          else:
              formatter = SandboxedFormatter(self)
  
          if format_func is not None and format_func.__name__ == "format_map":
              if len(args) != 1 or kwargs:
                  raise TypeError(
                      "format_map() takes exactly one argument %d given"
                      % (len(args) + (kwargs is not None))
                  )
  
              kwargs = args[0]
              args = None
  
          kwargs = _MagicFormatMapping(args, kwargs)
          rv = formatter.vformat(s, args, kwargs)
          return type(s)(rv)
function_tokens: def format_string ( self , s , args , kwargs , format_func = None ) : if isinstance ( s , Markup ) : formatter = SandboxedEscapeFormatter ( self , s . escape ) else : formatter = SandboxedFormatter ( self ) if format_func is not None and format_func . __name__ == "format_map" : if len ( args ) != 1 or kwargs : raise TypeError ( "format_map() takes exactly one argument %d given" % ( len ( args ) + ( kwargs is not None ) ) ) kwargs = args [ 0 ] args = None kwargs = _MagicFormatMapping ( args , kwargs ) rv = formatter . vformat ( s , args , kwargs ) return type ( s ) ( rv )