def convert(value, row):
    convert_key = crosswalk['final'].metadata.get_key(row, as_str=True)
    missing = crosswalk['final'].missing or 99
    unknown = crosswalk['final'].unknown or 99
    
    if not convert_key:
         return missing
    try:
        if convert_key == 'us':
            return crosswalk['us'].convert(crosswalk['us'].metadata.get_key(row, as_str=True))
        else:
            return crosswalk['final'].convert(convert_key)
    
    except ConvertError as e:
        log.write('astate', [row['id'], row['rapstatex'], convert_key, e])
        
        return unknown