
def transform(segment_name, records):
    admrec_var = 'non%s' % ('arr' if segment_name == 'arrest' else 'crt')
    valid_admrec_val = 2 if segment_name == 'arrest' else 3
    
    for record in records.itervalues():
        record['admrec_flag'] = True if record[admrec_var] != valid_admrec_val else False 