<commit_before>import json
import requests
import yaml

config = yaml.load(file("settings.yml"))

teams_file = open('teams.txt')
teams = []

for line in teams_file:
    teams.append(line.strip())

github_url = "https://api.github.com/repos/rosedu/{0}/stats/contributors"

for team in teams:
    req = requests.get(github_url.format(team), auth=(config['user'], config['password']))
    response = json.loads(req.content)
    noCommits = 0
    noLOC = 0

    for author in response:
        noCommits += author['total']
        noLOC += author['weeks'][0]['a'] + author['weeks'][0]['d']

    print "{0} - {1}".format(team, noCommits)

<commit_msg>if it fails, go silent<commit_after>import json
import requests
import time
import yaml

config = yaml.load(file("settings.yml"))

teams_file = open('teams.txt')
teams = []

for line in teams_file:
    teams.append(line.strip())

github_url = "https://api.github.com/repos/rosedu/{0}/stats/contributors"

for team in teams:
    req = requests.get(github_url.format(team), auth=(config['user'], config['password']))
    response = json.loads(req.content)
    noCommits = 0
    noLOC = 0

    for author in response:
        try:
            noCommits += author['total']
            noLOC += author['weeks'][0]['a'] + author['weeks'][0]['d']
        except:
            pass

    print "{0} - {1}".format(team, noCommits)
    time.sleep(3)

{'fraction_non_alphanumeric': 0.16618497109826588, 'fraction_numerical': 0.01083815028901734, 'mean_word_length': 3.4533762057877815, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '1935352', 'n_tokens_mistral': 475, 'n_tokens_neox': 460, 'n_words': 100}