def _parameterize_obj(obj):
    """Recursively parameterize all strings contained in an object.

    Parameterizes all values of a Mapping, all items of a Sequence, an
    unicode string, or pass other objects through unmodified.

    Byte strings will be interpreted as UTF-8.

    Args:
        obj: data to parameterize

    Return:
        A parameterized object to be included in a CloudFormation template.
        Mappings are converted to `dict`, Sequences are converted to  `list`,
        and strings possibly replaced by compositions of function calls.
    """

    if isinstance(obj, Mapping):
        return dict((key, _parameterize_obj(value))
                    for key, value in obj.items())
    elif isinstance(obj, bytes):
        return _parameterize_string(obj.decode('utf8'))
    elif isinstance(obj, str):
        return _parameterize_string(obj)
    elif isinstance(obj, Sequence):
        return list(_parameterize_obj(item) for item in obj)
    else:
        return obj
def _parameterize_obj ( obj ) : if isinstance ( obj , Mapping ) : return dict ( ( key , _parameterize_obj ( value ) ) for key , value in obj . items ( ) ) elif isinstance ( obj , bytes ) : return _parameterize_string ( obj . decode ( 'utf8' ) ) elif isinstance ( obj , str ) : return _parameterize_string ( obj ) elif isinstance ( obj , Sequence ) : return list ( _parameterize_obj ( item ) for item in obj ) else : return obj
Recursively parameterize all strings contained in an object.

    Parameterizes all values of a Mapping, all items of a Sequence, an
    unicode string, or pass other objects through unmodified.

    Byte strings will be interpreted as UTF-8.

    Args:
        obj: data to parameterize

    Return:
        A parameterized object to be included in a CloudFormation template.
        Mappings are converted to `dict`, Sequences are converted to  `list`,
        and strings possibly replaced by compositions of function calls.