def METHOD_NAME(obj):
    '''Recursively convert bytes to strings if possible'''
    ret = obj
    if isinstance(obj, dict):
        for k, v in obj.items():
            obj[k] = METHOD_NAME(v)
    elif isinstance(obj, list):
        for index, v in enumerate(obj):
            obj[index] = METHOD_NAME(v)
    elif isinstance(obj, bytes):
        # test for string
        try:
            ret = obj.decode('utf8', 'backslashreplace')
        except UnicodeDecodeError:
            ret = str(obj)
    return ret