def convert(value, row):
    missing = crosswalk['final'].missing or 9
    unknown = crosswalk['final'].unknown or None
    convert_key = get_state_key(row['rapstatex'])
    
    if not convert_key:
        return missing
    
    try:
        return crosswalk['final'].convert(convert_key)
    
    except ConvertError as e:
        log.write('csource', [row['id'], convert_key, "state not recognized", e])
        
        return unknown
