def _escape(s: str) -> str:
    """Performs backslash escaping on backslash, newline, and double-quote characters."""
    return s.replace('\\', r'\\').replace('\n', r'\n').replace('"', r'\"')
Performs backslash escaping on backslash, newline, and double-quote characters.
prometheus_client/openmetrics/exposition.py