<commit_before>from gittip import db, age

CARDINALS = ["zero", "one", "two", "three", "four", "five", "six", "seven", 
             "eight", "nine"]

# ========================================================================== ^L

npeople = db.fetchone("SELECT count(*) AS n FROM participants WHERE claimed_time IS NOT NULL")['n']
ncc = db.fetchone("SELECT count(*) AS n FROM participants WHERE last_bill_result = ''")['n']
statements = list(db.fetchall("SELECT id, statement FROM participants WHERE statement != '' ORDER BY id"))
amount = db.fetchone("SELECT transfer_volume AS v FROM paydays ORDER BY ts_end DESC LIMIT 1")['v']
average_tip = db.fetchone("""\
        SELECT avg(amount) FROM ( SELECT DISTINCT ON (tipper, tippee) amount 
                                    FROM tips 
                                    JOIN participants p ON tipper = p.id 
                                   WHERE p.last_bill_result = ''
                                 ) AS foo
""")['avg']
average_tippees = int(db.fetchone("""\
        SELECT round(avg(ntippees))
          FROM ( SELECT count(tippee) as NTIPPEES 
                   FROM ( SELECT DISTINCT ON (tipper, tippee) tipper, tippee 
                            FROM tips GROUP BY tipper, tippee
                         ) AS foo GROUP BY tipper) AS bar
""")['round'])

word = "people"
if average_tippees < 10:
    number = CARDINALS[average_tippees]
    if average_tippees == 1:
        word = "person" 
else:
    number = str(average_tippees)
other_people = "%s other %s" % (number, word)


def part(s):
    s = s.splitlines()[0]
    if len(s) > 60:
        s = s[:57].rsplit(None, 1)[0] + " ..."
    return s
<commit_msg>Constrain to tippees tipped by someone with a cc<commit_after>from gittip import db, age

CARDINALS = ["zero", "one", "two", "three", "four", "five", "six", "seven", 
             "eight", "nine"]

# ========================================================================== ^L

npeople = db.fetchone("SELECT count(*) AS n FROM participants WHERE claimed_time IS NOT NULL")['n']
ncc = db.fetchone("SELECT count(*) AS n FROM participants WHERE last_bill_result = ''")['n']
statements = list(db.fetchall("SELECT id, statement FROM participants WHERE statement != '' ORDER BY id"))
amount = db.fetchone("SELECT transfer_volume AS v FROM paydays ORDER BY ts_end DESC LIMIT 1")['v']
average_tip = db.fetchone("""\
        SELECT avg(amount) FROM ( SELECT DISTINCT ON (tipper, tippee) amount 
                                    FROM tips 
                                    JOIN participants p ON tipper = p.id 
                                   WHERE p.last_bill_result = ''
                                 ) AS foo
""")['avg']
average_tippees = int(db.fetchone("""\
        SELECT round(avg(ntippees))
          FROM ( SELECT count(tippee) as NTIPPEES 
                   FROM ( SELECT DISTINCT ON (tipper, tippee) tipper, tippee 
                            FROM tips
                            JOIN participants p ON tipper = p.id 
                           WHERE p.last_bill_result = ''
                        GROUP BY tipper, tippee
                         ) AS foo GROUP BY tipper) AS bar
""")['round'])

word = "people"
if average_tippees < 10:
    number = CARDINALS[average_tippees]
    if average_tippees == 1:
        word = "person" 
else:
    number = str(average_tippees)
other_people = "%s other %s" % (number, word)


def part(s):
    s = s.splitlines()[0]
    if len(s) > 60:
        s = s[:57].rsplit(None, 1)[0] + " ..."
    return s

{'fraction_non_alphanumeric': 0.1603399433427762, 'fraction_numerical': 0.006232294617563739, 'mean_word_length': 2.1810810810810812, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3059320', 'n_tokens_mistral': 1120, 'n_tokens_neox': 1008, 'n_words': 318}