def METHOD_NAME(filter):
    if filter["field"] != field.id:
        return filter
    filter_type = view_filter_type_registry.get(filter["type"])
    if not filter_type.field_is_compatible(field):
        return None
    return filter