Load the response from json data, return the dictionary or raw text

def _load_response(response):
    '''
    Load the response from json data, return the dictionary or raw text
    '''

    try:
        data = salt.utils.json.loads(response.text)
    except ValueError:
        data = response.text

    ret = {'code': response.status_code, 'content': data}

    return ret