<commit_before>import json


def check_response(response=None, expected_status=200):
    """
    Check the response from API calls to determine if they succeeded and
    if not, why.
    """
    code = response.status_code
    try:
        content = json.loads(response.content.decode('utf-8'))
        # TODO: look for 'success'
    except:
        print('unable to parse response (this is probably okay)')
    if code != expected_status:
        print(content)
        e = Exception('Expected {} but got {}'.format(expected_status, code))
        e.response = response
        raise e
    return True
<commit_msg>remove debugging line<commit_after>import json


def check_response(response=None, expected_status=200):
    """
    Check the response from API calls to determine if they succeeded and
    if not, why.
    """
    code = response.status_code
    try:
        content = json.loads(response.content.decode('utf-8'))
        # TODO: look for 'success'
    except:
        print('unable to parse response (this is probably okay)')
    if code != expected_status:
        e = Exception('Expected {} but got {}'.format(expected_status, code))
        e.response = response
        raise e
    return True

{'fraction_non_alphanumeric': 0.10041152263374485, 'fraction_numerical': 0.006584362139917695, 'mean_word_length': 2.753086419753086, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '574281', 'n_tokens_mistral': 336, 'n_tokens_neox': 330, 'n_words': 109}