MCPcopy Index your code
hub / github.com/prometheus/client_python / _get_version

Function _get_version

prometheus_client/exposition.py:372–383  ·  view source on GitHub ↗

Return the version tag from the Accept header. If no version is specified, returns empty string.

(accept_header: List[str])

Source from the content-addressed store, hash-verified

370
371
372def _get_version(accept_header: List[str]) -> str:
373 """Return the version tag from the Accept header.
374
375 If no version is specified, returns empty string."""
376
377 for tok in accept_header:
378 if '=' not in tok:
379 continue
380 key, value = tok.strip().split('=', 1)
381 if key == 'version':
382 return value
383 return ""
384
385
386def _get_escaping(accept_header: List[str]) -> str:

Callers 1

choose_encoderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected