MCPcopy Create free account
hub / github.com/SourceCode-AI/aura / qs_to_bool

Function qs_to_bool

aura/output/base.py:256–272  ·  view source on GitHub ↗

Convert value from query string to the bool format :param qs: value from the query string :type qs: str :return: converted value as bool :rtype: bool

(qs: Union[str, bool])

Source from the content-addressed store, hash-verified

254
255
256def qs_to_bool(qs: Union[str, bool]) -> bool:
257 """
258 Convert value from query string to the bool format
259
260 :param qs: value from the query string
261 :type qs: str
262 :return: converted value as bool
263 :rtype: bool
264 """
265 if type(qs) == bool:
266 return qs
267
268 qs = qs.lower()
269 if qs in ("y", "yes", "true", "1", "42", "jawohl", "da"):
270 return True
271 else:
272 return False

Callers 2

from_uriMethod · 0.85
from_uriMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected