MCPcopy
hub / github.com/tornadoweb/tornado / _get_arguments

Method _get_arguments

tornado/web.py:595–608  ·  view source on GitHub ↗
(
        self, name: str, source: Dict[str, List[bytes]], strip: bool = True
    )

Source from the content-addressed store, hash-verified

593 return args[-1]
594
595 def _get_arguments(
596 self, name: str, source: Dict[str, List[bytes]], strip: bool = True
597 ) -> List[str]:
598 values = []
599 for v in source.get(name, []):
600 s = self.decode_argument(v, name=name)
601 if isinstance(s, unicode_type):
602 # Get rid of any weird control chars (unless decoding gave
603 # us bytes, in which case leave it alone)
604 s = RequestHandler._remove_control_chars_regex.sub(" ", s)
605 if strip:
606 s = s.strip()
607 values.append(s)
608 return values
609
610 def decode_argument(self, value: bytes, name: Optional[str] = None) -> str:
611 """Decodes an argument from the request.

Callers 4

get_argumentsMethod · 0.95
get_body_argumentsMethod · 0.95
get_query_argumentsMethod · 0.95
_get_argumentMethod · 0.95

Calls 3

decode_argumentMethod · 0.95
appendMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected