<commit_before>import requests

response = requests.get('https://httpbin.org/get')
data = response.json()
print(data)<commit_msg>Fleshed out the API a bit<commit_after>import os
import requests
import logging


def getPagerDutyAlerts():
    logging.basicConfig(level=logging.DEBUG)

    authToken = os.environ.get('PAGERDUTY_API_KEY', None)
    headers = {
        "Accept": "application/vnd.pagerduty+json;version=2",
        "Authorization": "Token token="+authToken,
    }
    # response = requests.get('https://api.pagerduty.com/services', headers=headers)
    response = requests.get('https://api.pagerduty.com/alerts', headers=headers)
    if response:
        try:
            print(response.text)
            json_response = response.json()
            return json_response
        except:
            print("Couldn't parse response: "+response)
    else:
        print("DIDN'T GET A RESPONSE")
    return None

response = getPagerDutyAlerts()
# if response is not None and response.get('services') is not None:
#     d = {}
#     for service in response.get('services'):
#         d[service.get('name')] = service.get('id')
#     print(d)


if response is not None and response.get('alerts') is not None:
    d = {}
    for alert in response.get('alerts'):
        d[alert.get('id')] = alert.get('status')
        # service = alert.get('service')
        # if service is not None and service.get('summary') is not None:
        #     d[service.get('summary')] = alert
    print(d)


{'fraction_non_alphanumeric': 0.13682092555331993, 'fraction_numerical': 0.0006706908115358819, 'mean_word_length': 3.010752688172043, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, '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': '4040019', 'n_tokens_mistral': 464, 'n_tokens_neox': 456, 'n_words': 107}