@staticmethod
def escape(s):
    """
        Double { and } characters in a string to 'escape' them so ``str.format``
        doesn't treat them as template characters. NB This is NOT idempotent!
        Escaping more than once (when { or } are present ) = ERROR.
        """
    return s.replace('{', '{{').replace('}', '}}')
