testing/trigger_scripts/base_test_triggerer.py
def strip_unicode(obj):
    """Recursively re-encodes strings as utf-8 inside |obj|. Returns the result.
  """
    if isinstance(obj, six.text_type):
        return obj.encode('utf-8', 'replace')
    if isinstance(obj, list):
        return list(map(strip_unicode, obj))

    if isinstance(obj, dict):
        new_obj = type(obj)(
            (strip_unicode(k), strip_unicode(v)) for k, v in obj.items())
        return new_obj
    return obj
Recursively re-encodes strings as utf-8 inside |obj|. Returns the result.
  
Recursively re-encodes strings as utf-8 inside |obj|. Returns the result.
Recursively re - encodes strings as utf - 8 inside |obj| . Returns the result .
def strip_unicode(obj):
    if isinstance(obj, six.text_type):
        return obj.encode('utf-8', 'replace')
    if isinstance(obj, list):
        return list(map(strip_unicode, obj))
    if isinstance(obj, dict):
        new_obj = type(obj)(
            (strip_unicode(k), strip_unicode(v)) for k, v in obj.items())
        return new_obj
    return obj
def strip_unicode ( obj ) : if isinstance ( obj , six . text_type ) : return obj . encode ( 'utf-8' , 'replace' ) if isinstance ( obj , list ) : return list ( map ( strip_unicode , obj ) ) if isinstance ( obj , dict ) : new_obj = type ( obj ) ( ( strip_unicode ( k ) , strip_unicode ( v ) ) for k , v in obj . items ( ) ) return new_obj return obj
Recursively re-encodes strings as utf-8 inside |obj|.
Recursively re - encodes strings as utf - 8 inside |obj| .
"""Recursively re-encodes strings as utf-8 inside |obj|. Returns the result.
  """
obj