MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / _encode_bytes_value

Function _encode_bytes_value

py/private/_network_handlers.py:97–103  ·  view source on GitHub ↗

Encode a plain string as a BiDi BytesValue dict; pass dicts through.

(value: Any)

Source from the content-addressed store, hash-verified

95
96
97def _encode_bytes_value(value: Any) -> Any:
98 """Encode a plain string as a BiDi BytesValue dict; pass dicts through."""
99 if isinstance(value, str):
100 return {"type": "string", "value": value}
101 if hasattr(value, "to_bidi_dict"):
102 return value.to_bidi_dict()
103 return value
104
105
106def headers_to_dict(headers: list | None) -> dict[str, str]:

Callers 6

dict_to_headersFunction · 0.85
list_to_cookie_headersFunction · 0.85
_continue_paramsMethod · 0.85

Calls 1

to_bidi_dictMethod · 0.80

Tested by

no test coverage detected