def escape(s: str, escapes: Iterable[Tuple[(str, str)]]) -> str:
    "\n    'escapes' is an iterable of (pattern, substitute) pairs\n    "
    for (pattern, sub) in escapes:
        s = s.replace(pattern, sub)
    return s
'escapes' is an iterable of (pattern, substitute) pairs
def escape(s: str, escapes: Iterable[Tuple[(str, str)]]) -> str:
    "\n    \n    "
    for (pattern, sub) in escapes:
        s = s.replace(pattern, sub)
    return s