<commit_before>from collections import defaultdict
from csv import DictReader, DictWriter
import heapq

kHEADER = ["STATE", "DISTRICT", "MARGIN"]

def district_margins(state_lines):
    """
    Return a dictionary with keys as districts as keys and the difference in
    percentage between the winner and the second-place.

    @lines The csv rows that correspond to the districts of a single state
    """

    # Complete this function
    percentages = {}

    return dict((int(x["D"]), 25.0) for x in state_lines if x["D"] and x["D"] != "H")

def all_states(lines):
    """<commit_msg>Update districts.py<commit_after>from collections import defaultdict
from csv import DictReader, DictWriter
import heapq

kHEADER = ["STATE", "DISTRICT", "MARGIN"]

def district_margins(state_lines):
    """
    Return a dictionary with districts as keys, and the difference in
    percentage between the winner and the second-place as values.

    @lines The csv rows that correspond to the districts of a single state
    """

    # Complete this function
    percentages = {}

    return dict((int(x["D"]), 25.0) for x in state_lines if x["D"] and x["D"] != "H")

def all_states(lines):
    """
{'fraction_non_alphanumeric': 0.10464135021097046, 'fraction_numerical': 0.005063291139240506, 'mean_word_length': 3.880658436213992, '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': '1514217', 'n_tokens_mistral': 355, 'n_tokens_neox': 338, 'n_words': 137}