def mark_for_escaping(s):
 if isinstance(s, (SafeData, EscapeData)):
  return s
 if (isinstance(s, bytes) or (isinstance(s, Promise) and s._delegate_bytes)):
  return EscapeBytes(s)
 if isinstance(s, (six.text_type, Promise)):
  return EscapeText(s)
 return EscapeBytes(bytes(s))

def mark_for_escaping ( s ) : if isinstance ( s , ( SafeData , EscapeData ) ) : return s if ( isinstance ( s , bytes ) or ( isinstance ( s , Promise ) and s . _delegate_bytes ) ) : return EscapeBytes ( s ) if isinstance ( s , ( six . text_type , Promise ) ) : return EscapeText ( s ) return EscapeBytes ( bytes ( s ) )
explicitly mark a string as requiring html escaping upon output .