<commit_before>import logging

from BeautifulSoup import BeautifulSoup

from datafeeds.parser_base import ParserBase

class UsfirstEventAwardsParser(ParserBase):
    """
    Works for official events from 2007-2012
    Note: awards are matched by award names below, but the award names
    displayed will be the award names listed on the USFIRST event pages.
    Awards must contain every string in the the first list of the tuple
    and must NOT contain any string in the second list of the tuple
    """
    AWARD_NAMES = [
        ("ca", (["chairman"], [])),
        ("ei", (["engineering inspiration"], [])),
        ("win1", (["winner", "1"], [])),
        ("win2", (["winner", "2"], [])),
        ("win3", (["winner", "3"], [])),
        ("win4", (["winner", "4"], [])),
        ("win1", (["championship", "champion", "1"], ["finalist"])),
        ("win2", (["championship", "champion", "2"], ["finalist"])),
        ("win3", (["championship", "champion", "3"], ["finalist"])),
        ("win4", (["championship", "champion", "4"], ["finalist"])),
        ("fin1", (["finalist", "1"], ["dean"])),
        ("fin2", (["finalist", "2"], ["dean"])),
        ("fin3", (["finalist", "3"], ["dean"])),
        ("fin4", (["finalist", "4"], ["dean"])),
        ("coop", (["coopertition"], [])),
        ("sports", (["sportsmanship"], [])),
        ("create", (["creativity"], [])),
        ("eng", (["engineering excellence"], [])),
        ("entre", (["entrepreneurship"], [])),
        ("exdes", (["excellence in design"], [])),
        ("dl", (["dean's list"], [])),
        ("driv", (["driving", "tomorrow", "technology"], [])),
        ("gp", (["gracious professionalism"], [])),
        ("hrs", (["highest rookie seed"], [])),
        ("image", (["imagery"], [])),
        ("ind", (["industrial design"], [])),
        ("safe", (["safety"], [])),
        ("control", (["innovation in control"], [])),
        ("quality", (["quality"], [])),
        ("ras", (["rookie", "all", "star"], [])),
        ("rinspire", (["rookie inspiration"], [])),
        ("spirit", (["spirit"], [])),
        ("web", (["website"], [])),
        ("vis", (["visualization"], [])),
        ("vol", (["volunteer"], [])),
        ("wfa", (["woodie flowers"], [])),
        ("judge", (["judge"], [])),
        ("founders", (["founder"], [])),
        ("inventor", (["autodesk inventor"], [])),
        ("innovator", (["future innovator"], []))
    ]
    INDIVIDUAL_AWARDS = ["dl", "dl1", "dl2", "dl3", "dl4", "dl5", "dl6", "dl7", "dl8", "dl9", "vol", "wfa", "founders"]    
    YEAR_SPECIFIC = {'2012': {'official': 0,<commit_msg>Better way to parse excellence in engineering award<commit_after>import logging

from BeautifulSoup import BeautifulSoup

from datafeeds.parser_base import ParserBase

class UsfirstEventAwardsParser(ParserBase):
    """
    Works for official events from 2007-2012
    Note: awards are matched by award names below, but the award names
    displayed will be the award names listed on the USFIRST event pages.
    Awards must contain every string in the the first list of the tuple
    and must NOT contain any string in the second list of the tuple
    """
    AWARD_NAMES = [
        ("ca", (["chairman"], [])),
        ("ei", (["engineering inspiration"], [])),
        ("win1", (["winner", "1"], [])),
        ("win2", (["winner", "2"], [])),
        ("win3", (["winner", "3"], [])),
        ("win4", (["winner", "4"], [])),
        ("win1", (["championship", "champion", "1"], ["finalist"])),
        ("win2", (["championship", "champion", "2"], ["finalist"])),
        ("win3", (["championship", "champion", "3"], ["finalist"])),
        ("win4", (["championship", "champion", "4"], ["finalist"])),
        ("fin1", (["finalist", "1"], ["dean"])),
        ("fin2", (["finalist", "2"], ["dean"])),
        ("fin3", (["finalist", "3"], ["dean"])),
        ("fin4", (["finalist", "4"], ["dean"])),
        ("coop", (["coopertition"], [])),
        ("sports", (["sportsmanship"], [])),
        ("create", (["creativity"], [])),
        ("eng", (["engineering", "excellence"], [])),
        ("entre", (["entrepreneurship"], [])),
        ("exdes", (["excellence in design"], [])),
        ("dl", (["dean's list"], [])),
        ("driv", (["driving", "tomorrow", "technology"], [])),
        ("gp", (["gracious professionalism"], [])),
        ("hrs", (["highest rookie seed"], [])),
        ("image", (["imagery"], [])),
        ("ind", (["industrial design"], [])),
        ("safe", (["safety"], [])),
        ("control", (["innovation in control"], [])),
        ("quality", (["quality"], [])),
        ("ras", (["rookie", "all", "star"], [])),
        ("rinspire", (["rookie inspiration"], [])),
        ("spirit", (["spirit"], [])),
        ("web", (["website"], [])),
        ("vis", (["visualization"], [])),
        ("vol", (["volunteer"], [])),
        ("wfa", (["woodie flowers"], [])),
        ("judge", (["judge"], [])),
        ("founders", (["founder"], [])),
        ("inventor", (["autodesk inventor"], [])),
        ("innovator", (["future innovator"], []))
    ]
    INDIVIDUAL_AWARDS = ["dl", "dl1", "dl2", "dl3", "dl4", "dl5", "dl6", "dl7", "dl8", "dl9", "vol", "wfa", "founders"]    
    YEAR_SPECIFIC = {'2012': {'official': 0,
{'fraction_non_alphanumeric': 0.28487155090390104, 'fraction_numerical': 0.017507136060894386, 'mean_word_length': 3.198083067092652, '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': '4215665', 'n_tokens_mistral': 1803, 'n_tokens_neox': 1737, 'n_words': 426}