MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / _normalize_headers

Function _normalize_headers

sdks/python/src/e2a/v1/errors.py:311–323  ·  view source on GitHub ↗
(headers: Any)

Source from the content-addressed store, hash-verified

309
310
311def _normalize_headers(headers: Any) -> Optional[Mapping[str, str]]:
312 if headers is None:
313 return None
314 if isinstance(headers, Mapping):
315 return headers
316 # httpx.Headers / list of pairs both iterate as items().
317 try:
318 return dict(headers.items()) # type: ignore[no-any-return]
319 except AttributeError:
320 try:
321 return dict(headers)
322 except (TypeError, ValueError):
323 return None
324
325
326def _parse_envelope(data: Any, body: Any) -> Any:

Callers 1

from_api_exceptionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected