<commit_before>from . import base
from . import mixins

from datetime import date


class TransformedRecord(mixins.GenericCompensationMixin,
        mixins.GenericIdentifierMixin, mixins.GenericPersonMixin,
        mixins.MembershipMixin, mixins.OrganizationMixin, mixins.PostMixin,
        mixins.RaceMixin, mixins.LinkMixin, base.BaseTransformedRecord):

    MAP = {
        'last_name': '<NAME>',
        'first_name': '<NAME>',
        'department': 'Location',
        'job_title': 'Job Title',
        'hire_date': 'Hire Date',
        'compensation': 'Salary',
        'employee_type': 'Part Time Full Time',
        'gender': 'Gender',
    }

    NAME_FIELDS = ('first_name', 'last_name', )

    ORGANIZATION_NAME = '<NAME>D'

    ORGANIZATION_CLASSIFICATION = 'School District'

    DATE_PROVIDED = date(2016, 5, 26)
    # Y/M/D agency provided the data

    # TODO
    URL = "http://raw.texastribune.org.s3.amazonaws.com/katy_isd/salaries/2016-05/PIR%2015524-30-E%20%20Employee%20list.xlsx"

    description = 'Annual compensation'

    ethnicity_choices = ['American Indian', 'Asian', 'Black', 'White',
                         'Pacific Islander', 'Hispanic Ethnicity']

    @property
    def is_valid(self):
        # Adjust to return False on invalid fields.  For example:
        return self.last_name.strip() != ''

    @property
    def race(self):
        ethnicities = []
        for choice in self.ethnicity_choices:
            if self.data[choice] == "Y":
                ethnicities.append(choice)
        ethnicity = " ".join(ethnicities)
        if ethnicity == '':
            ethnicity = 'Not given'
        return {
            'name': ethnicity.strip()
        }

    @property
    def compensation_type(self):
        employee_type = self.employee_type
<commit_msg>pep8 fixes, use commas for ethnicities<commit_after>from . import base
from . import mixins

from datetime import date


class TransformedRecord(
    mixins.GenericCompensationMixin,
    mixins.GenericIdentifierMixin, mixins.GenericPersonMixin,
    mixins.MembershipMixin, mixins.OrganizationMixin, mixins.PostMixin,
        mixins.RaceMixin, mixins.LinkMixin, base.BaseTransformedRecord):

    MAP = {
        'last_name': '<NAME>',
        'first_name': '<NAME>',
        'department': 'Location',
        'job_title': 'Job Title',
        'hire_date': 'Hire Date',
        'compensation': 'Salary',
        'employee_type': 'Part Time Full Time',
        'gender': 'Gender',
    }

    NAME_FIELDS = ('first_name', 'last_name', )

    ORGANIZATION_NAME = '<NAME>'

    ORGANIZATION_CLASSIFICATION = 'School District'

    DATE_PROVIDED = date(2016, 5, 26)
    # Y/M/D agency provided the data

    # TODO
    URL = ("http://raw.texastribune.org.s3.amazonaws.com/katy_isd/salaries"
           "/2016-05/PIR%2015524-30-E%20%20Employee%20list.xlsx")

    description = 'Annual compensation'

    ethnicity_choices = ['American Indian', 'Asian', 'Black', 'White',
                         'Pacific Islander', 'Hispanic Ethnicity']

    @property
    def is_valid(self):
        # Adjust to return False on invalid fields.  For example:
        return self.last_name.strip() != ''

    @property
    def race(self):
        ethnicities = []
        for choice in self.ethnicity_choices:
            if self.data[choice] == "Y":
                if choice == 'Hispanic Ethnicity':
                    ethnicities.append('Hispanic')
                else:
                    ethnicities.append(choice)
        ethnicity = ", ".join(ethnicities)
        if ethnicity == '':
            ethnicity = 'Not given'
        return {
            'name': ethnicity.strip()
        }

    @property
    def compensation_type(self):
        employee_type = self.employee_type

{'fraction_non_alphanumeric': 0.11907298881193394, 'fraction_numerical': 0.015716568993074054, 'mean_word_length': 2.4672206832871653, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 9, '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': '3422568', 'n_tokens_mistral': 1236, 'n_tokens_neox': 1144, 'n_words': 245}