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

Function _unquote_unescape

prometheus_client/parser.py:204–217  ·  view source on GitHub ↗

Returns the string, and true if it was quoted.

(text)

Source from the content-addressed store, hash-verified

202
203
204def _unquote_unescape(text):
205 """Returns the string, and true if it was quoted."""
206 if not text:
207 return text, False
208 quoted = False
209 text = text.strip()
210 if text[0] == '"':
211 if len(text) == 1 or text[-1] != '"':
212 raise ValueError("missing close quote")
213 text = text[1:-1]
214 quoted = True
215 if "\\" in text:
216 text = _replace_escaping(text)
217 return text, quoted
218
219
220# If we have multiple values only consider the first

Callers 3

parse_labelsFunction · 0.85

Calls 1

_replace_escapingFunction · 0.70

Tested by

no test coverage detected