def METHOD_NAME(response):
    try:
        result = json.loads(response.content.decode('utf-8', 'ignore'), strict=False)
    except (TypeError, ValueError):
        return response
    else:
        return result