def process_data(data, sess, atom_type, sub_tier_list, county_by_name, county_by_code, state_code_list, country_list, exec_comp_dict):
    " Process the data coming in.\n\n        Args:\n            data: an object containing the data gathered from the feed\n            sess: the database connection\n            atom_type: a string indicating whether the atom feed being checked is 'award' or 'IDV'\n            sub_tier_list: a dictionary containing all the sub tier agency information keyed by sub tier agency code\n            county_by_name: a dictionary containing all county codes, keyed by state and county name\n            county_by_code: a dictionary containing all county names, keyed by state and county code\n            state_code_list: a dictionary containing all state names, keyed by state code\n            country_list: a dictionary containing all country names, keyed by country code\n            exec_comp_dict: a dictionary containing all the data for Executive Compensation data keyed by DUNS number\n\n        Returns:\n            An object containing the processed and calculated data.\n    "
    obj = {}
    if (atom_type == 'award'):
        try:
            data['awardID']
        except KeyError:
            data['awardID'] = {}
        obj = award_id_values(data['awardID'], obj)
    else:
        obj['transaction_number'] = None
        try:
            data['contractID']
        except KeyError:
            data['contractID'] = {}
        obj = contract_id_values(data['contractID'], obj)
    try:
        data['competition']
    except KeyError:
        data['competition'] = {}
    obj = competition_values(data['competition'], obj)
    try:
        data['contractData']
    except KeyError:
        data['contractData'] = {}
    obj = contract_data_values(data['contractData'], obj, atom_type)
    try:
        data['dollarValues']
    except KeyError:
        data['dollarValues'] = {}
    obj = dollar_values_values(data['dollarValues'], obj)
    try:
        data['totalDollarValues']
    except KeyError:
        data['totalDollarValues'] = {}
    obj = total_dollar_values_values(data['totalDollarValues'], obj)
    if (atom_type == 'award'):
        try:
            data['placeOfPerformance']
        except KeyError:
            data['placeOfPerformance'] = {}
        obj = place_of_performance_values(data['placeOfPerformance'], obj)
    else:
        obj['place_of_perform_county_na'] = None
        obj['place_of_performance_state'] = None
        obj['place_of_perfor_state_desc'] = None
        obj['place_of_performance_zip4a'] = None
        obj['place_of_perform_country_c'] = None
        obj['place_of_perf_country_desc'] = None
    try:
        data['legislativeMandates']
    except KeyError:
        data['legislativeMandates'] = {}
    obj = legislative_mandates_values(data['legislativeMandates'], obj)
    try:
        obj['subcontracting_plan'] = extract_text(data['preferencePrograms']['subcontractPlan'])
    except (KeyError, TypeError):
        obj['subcontracting_plan'] = None
    try:
        obj['subcontracting_plan_desc'] = extract_text(data['preferencePrograms']['subcontractPlan']['@description'])
    except (KeyError, TypeError):
        obj['subcontracting_plan_desc'] = None
    try:
        data['productOrServiceInformation']
    except KeyError:
        data['productOrServiceInformation'] = {}
    obj = product_or_service_information_values(data['productOrServiceInformation'], obj)
    try:
        data['purchaserInformation']
    except KeyError:
        data['purchaserInformation'] = {}
    obj = purchaser_information_values(data['purchaserInformation'], obj)
    try:
        data['relevantContractDates']
    except KeyError:
        data['relevantContractDates'] = {}
    obj = relevant_contract_dates_values(data['relevantContractDates'], obj)
    try:
        data['vendor']
    except KeyError:
        data['vendor'] = {}
    obj = vendor_values(data['vendor'], obj)
    try:
        data['genericTags']
    except KeyError:
        data['genericTags'] = {}
    obj = generic_values(data['genericTags'], obj)
    obj = calculate_remaining_fields(obj, sess, sub_tier_list, county_by_name, county_by_code, state_code_list, country_list, exec_comp_dict, atom_type)
    try:
        obj['last_modified'] = extract_text(data['transactionInformation']['lastModifiedDate'])
    except (KeyError, TypeError):
        obj['last_modified'] = None
    try:
        obj['initial_report_date'] = extract_text(data['transactionInformation']['createdDate'])
    except (KeyError, TypeError):
        obj['initial_report_date'] = None
    obj['pulled_from'] = atom_type
    free_fields = ['award_description', 'vendor_doing_as_business_n', 'legal_entity_address_line1', 'legal_entity_address_line2', 'legal_entity_address_line3', 'ultimate_parent_legal_enti', 'awardee_or_recipient_legal', 'other_statutory_authority']
    for field in free_fields:
        if obj[field]:
            obj[field] = re.sub('\\s', ' ', obj[field])
    return obj
Process the data coming in.

Args:
    data: an object containing the data gathered from the feed
    sess: the database connection
    atom_type: a string indicating whether the atom feed being checked is 'award' or 'IDV'
    sub_tier_list: a dictionary containing all the sub tier agency information keyed by sub tier agency code
    county_by_name: a dictionary containing all county codes, keyed by state and county name
    county_by_code: a dictionary containing all county names, keyed by state and county code
    state_code_list: a dictionary containing all state names, keyed by state code
    country_list: a dictionary containing all country names, keyed by country code
    exec_comp_dict: a dictionary containing all the data for Executive Compensation data keyed by DUNS number

Returns:
    An object containing the processed and calculated data.
def process_data(data, sess, atom_type, sub_tier_list, county_by_name, county_by_code, state_code_list, country_list, exec_comp_dict):
    " Process the data coming in.\n\n        Args:\n            data: an object containing the data gathered from the feed\n            sess: the database connection\n            atom_type: a string indicating whether the atom feed being checked is 'award' or 'IDV'\n            sub_tier_list: a dictionary containing all the sub tier agency information keyed by sub tier agency code\n            county_by_name: a dictionary containing all county codes, keyed by state and county name\n            county_by_code: a dictionary containing all county names, keyed by state and county code\n            state_code_list: a dictionary containing all state names, keyed by state code\n            country_list: a dictionary containing all country names, keyed by country code\n            exec_comp_dict: a dictionary containing all the data for Executive Compensation data keyed by DUNS number\n\n        Returns:\n            An object containing the processed and calculated data.\n    "
    obj = {}
    if (atom_type == 'award'):
        try:
            data['awardID']
        except KeyError:
            data['awardID'] = {}
        obj = award_id_values(data['awardID'], obj)
    else:
        obj['transaction_number'] = None
        try:
            data['contractID']
        except KeyError:
            data['contractID'] = {}
        obj = contract_id_values(data['contractID'], obj)
    try:
        data['competition']
    except KeyError:
        data['competition'] = {}
    obj = competition_values(data['competition'], obj)
    try:
        data['contractData']
    except KeyError:
        data['contractData'] = {}
    obj = contract_data_values(data['contractData'], obj, atom_type)
    try:
        data['dollarValues']
    except KeyError:
        data['dollarValues'] = {}
    obj = dollar_values_values(data['dollarValues'], obj)
    try:
        data['totalDollarValues']
    except KeyError:
        data['totalDollarValues'] = {}
    obj = total_dollar_values_values(data['totalDollarValues'], obj)
    if (atom_type == 'award'):
        try:
            data['placeOfPerformance']
        except KeyError:
            data['placeOfPerformance'] = {}
        obj = place_of_performance_values(data['placeOfPerformance'], obj)
    else:
        obj['place_of_perform_county_na'] = None
        obj['place_of_performance_state'] = None
        obj['place_of_perfor_state_desc'] = None
        obj['place_of_performance_zip4a'] = None
        obj['place_of_perform_country_c'] = None
        obj['place_of_perf_country_desc'] = None
    try:
        data['legislativeMandates']
    except KeyError:
        data['legislativeMandates'] = {}
    obj = legislative_mandates_values(data['legislativeMandates'], obj)
    try:
        obj['subcontracting_plan'] = extract_text(data['preferencePrograms']['subcontractPlan'])
    except (KeyError, TypeError):
        obj['subcontracting_plan'] = None
    try:
        obj['subcontracting_plan_desc'] = extract_text(data['preferencePrograms']['subcontractPlan']['@description'])
    except (KeyError, TypeError):
        obj['subcontracting_plan_desc'] = None
    try:
        data['productOrServiceInformation']
    except KeyError:
        data['productOrServiceInformation'] = {}
    obj = product_or_service_information_values(data['productOrServiceInformation'], obj)
    try:
        data['purchaserInformation']
    except KeyError:
        data['purchaserInformation'] = {}
    obj = purchaser_information_values(data['purchaserInformation'], obj)
    try:
        data['relevantContractDates']
    except KeyError:
        data['relevantContractDates'] = {}
    obj = relevant_contract_dates_values(data['relevantContractDates'], obj)
    try:
        data['vendor']
    except KeyError:
        data['vendor'] = {}
    obj = vendor_values(data['vendor'], obj)
    try:
        data['genericTags']
    except KeyError:
        data['genericTags'] = {}
    obj = generic_values(data['genericTags'], obj)
    obj = calculate_remaining_fields(obj, sess, sub_tier_list, county_by_name, county_by_code, state_code_list, country_list, exec_comp_dict, atom_type)
    try:
        obj['last_modified'] = extract_text(data['transactionInformation']['lastModifiedDate'])
    except (KeyError, TypeError):
        obj['last_modified'] = None
    try:
        obj['initial_report_date'] = extract_text(data['transactionInformation']['createdDate'])
    except (KeyError, TypeError):
        obj['initial_report_date'] = None
    obj['pulled_from'] = atom_type
    free_fields = ['award_description', 'vendor_doing_as_business_n', 'legal_entity_address_line1', 'legal_entity_address_line2', 'legal_entity_address_line3', 'ultimate_parent_legal_enti', 'awardee_or_recipient_legal', 'other_statutory_authority']
    for field in free_fields:
        if obj[field]:
            obj[field] = re.sub('\\s', ' ', obj[field])
    return obj