def _force_text_recursive(data):
    """
    Descend into a nested data structure, forcing any
    lazy translation strings into plain text.
    """
    if isinstance(data, list):
        ret = [
            _force_text_recursive(item) for item in data
        ]
        if isinstance(data, ReturnList):
            return ReturnList(ret, serializer=data.serializer)
        return data
    elif isinstance(data, dict):
        ret = {
            key: _force_text_recursive(value)
            for key, value in data.items()
        }
        if isinstance(data, ReturnDict):
            return ReturnDict(ret, serializer=data.serializer)
        return data
    return force_text(data)
def _force_text_recursive ( data ) : if isinstance ( data , list ) : ret = [ _force_text_recursive ( item ) for item in data ] if isinstance ( data , ReturnList ) : return ReturnList ( ret , serializer = data . serializer ) return data elif isinstance ( data , dict ) : ret = { key : _force_text_recursive ( value ) for key , value in data . items ( ) } if isinstance ( data , ReturnDict ) : return ReturnDict ( ret , serializer = data . serializer ) return data return force_text ( data )
Descend into a nested data structure, forcing any
    lazy translation strings into plain text.