
def set_flag(segment, records, **kw):
    chg = '%schg' % ('a' if segment == 'arrest' else 'c')
    
    for record in records.itervalues():
        record['off_del_flag'] = True if record[chg] in kw['off_flags'] else False
    
    