def contract_id_values(data, obj):
    ' Get values from the contractID level of the xml '
    value_map = {'modNumber': 'award_modification_amendme', 'PIID': 'piid', 'agencyID': 'agency_id'}
    for (key, value) in value_map.items():
        try:
            obj[value] = extract_text(data['IDVID'][key])
        except (KeyError, TypeError):
            obj[value] = None
    value_map = {'agencyID': 'referenced_idv_agency_iden', 'modNumber': 'referenced_idv_modificatio', 'PIID': 'parent_award_id'}
    for (key, value) in value_map.items():
        try:
            obj[value] = extract_text(data['referencedIDVID'][key])
        except (KeyError, TypeError):
            obj[value] = None
    try:
        obj['referenced_idv_agency_desc'] = extract_text(data['referencedIDVID']['agencyID']['@name'])
    except (KeyError, TypeError):
        obj['referenced_idv_agency_desc'] = None
    return obj
Get values from the contractID level of the xml
def contract_id_values(data, obj):
    '  '
    value_map = {'modNumber': 'award_modification_amendme', 'PIID': 'piid', 'agencyID': 'agency_id'}
    for (key, value) in value_map.items():
        try:
            obj[value] = extract_text(data['IDVID'][key])
        except (KeyError, TypeError):
            obj[value] = None
    value_map = {'agencyID': 'referenced_idv_agency_iden', 'modNumber': 'referenced_idv_modificatio', 'PIID': 'parent_award_id'}
    for (key, value) in value_map.items():
        try:
            obj[value] = extract_text(data['referencedIDVID'][key])
        except (KeyError, TypeError):
            obj[value] = None
    try:
        obj['referenced_idv_agency_desc'] = extract_text(data['referencedIDVID']['agencyID']['@name'])
    except (KeyError, TypeError):
        obj['referenced_idv_agency_desc'] = None
    return obj