def METHOD_NAME(
    column: SaColumn,
    criterion: criteria.BaseCriterion,
    transformer: Callable[[str], str] = wildcard_transformer,
) -> SaQuery:
    if isinstance(criterion, criteria.PlainCriterion):
        expr = column.ilike(transformer(criterion.value))
    elif isinstance(criterion, criteria.ArrayCriterion):
        expr = sa.sql.false()
        for value in criterion.values:
            expr = expr | column.ilike(transformer(value))
    elif isinstance(criterion, criteria.RangedCriterion):
        raise errors.SearchError(
            "Ranged criterion is invalid in this context. "
            "Did you forget to escape the dots?"
        )
    else:
        assert False
    return expr