Return a new expression, with any eligible comparisons lowered to `between` clauses.
972754
def _lower_expressions_to_between(base_expression):
    """"""
    expression_list = list(_extract_conjuction_elements_from_expression(base_expression))
    if len(expression_list) == 0:
        raise AssertionError(u'Received empty expression_list {} from base_expression: '
                             u'{}'.format(expression_list, base_expression))
    elif len(expression_list) == 1:
        return base_expression
    else:
        between_operators = (u'<=', u'>=')
        local_field_to_expressions, new_expression_list = _construct_field_operator_expression_dict(
            expression_list)

        lowering_occurred = False
        for field_name in local_field_to_expressions:
            expressions_dict = local_field_to_expressions[field_name]
            if all(operator in expressions_dict and len(expressions_dict[operator]) == 1
                   for operator in between_operators):
                field = LocalField(field_name)
                lower_bound = expressions_dict[u'>='][0].right
                upper_bound = expressions_dict[u'<='][0].right
                new_expression_list.appendleft(BetweenClause(field, lower_bound, upper_bound))
                lowering_occurred = True
            else:
                for expression in expressions_dict.values():
                    new_expression_list.extend(expression)

        if lowering_occurred:
            return _expression_list_to_conjunction(list(new_expression_list))
        else:
            return base_expression
1155561
public final BooleanExpression notBetween(T from, T to) {
        return between(from, to).not();
    }
769064
public static Optional<Condition> createBetweenCondition(final PredicateBetweenRightValue betweenRightValue, final Column column) {
        return betweenRightValue.getBetweenExpression() instanceof SimpleExpressionSegment && betweenRightValue.getAndExpression() instanceof SimpleExpressionSegment
                ? Optional.of(new Condition(column,
                ((SimpleExpressionSegment) betweenRightValue.getBetweenExpression()).getSQLExpression(), ((SimpleExpressionSegment) betweenRightValue.getAndExpression()).getSQLExpression()))
                : Optional.<Condition>absent();
    }
1130536
void swapCondition() {

        int i = OpTypes.EQUAL;

        switch (opType) {

            case OpTypes.GREATER_EQUAL :
                i = OpTypes.SMALLER_EQUAL;
                break;

            case OpTypes.SMALLER_EQUAL :
                i = OpTypes.GREATER_EQUAL;
                break;

            case OpTypes.SMALLER :
                i = OpTypes.GREATER;
                break;

            case OpTypes.GREATER :
                i = OpTypes.SMALLER;
                break;

            case OpTypes.NOT_DISTINCT :
                i = OpTypes.NOT_DISTINCT;
                break;

            case OpTypes.EQUAL :
                break;

            default :
                throw Error.runtimeError(ErrorCode.U_S0500,
                                         "Expression.swapCondition");
        }

        opType = i;

        Expression e = nodes[LEFT];

        nodes[LEFT]  = nodes[RIGHT];
        nodes[RIGHT] = e;
    }
817817
public Expression<Calendar> between(Calendar startValue, Calendar endValue) {
		String valueString = "'" + getCalendarAsString(startValue).concat("Z") + "' AND '" + getCalendarAsString(endValue) + "'";
		return new Expression<Calendar>(this, Operation.between, valueString);
	}
765732
public Expression2 substitute(int index, String newConstantExpression) {
    return substitute(index, Expression2.constant(newConstantExpression));
  }
111873
public Expression<Integer> between(Integer startValue, Integer endValue) {
		String valueString = "'" + startValue + "' AND '" + endValue + "'";
		return new Expression<Integer>(this, Operation.between, valueString);
	}
460979
def _CreateMultipleValuesCondition(self, values, operator):
    """"""
    values = ['"%s"' % value if isinstance(value, str) or
              isinstance(value, unicode) else str(value) for value in values]
    return '%s %s [%s]' % (self._field, operator, ', '.join(values))
781962
def _create_exprs_using_func(self, f, columns):
        """"""
        expressions = map(lambda c: f(c).alias(c),
                          self._columns)
        return expressions
1363388
public static Between between( String property, int minimum, int maximum)
    {
    return new Between( notLessThan( property, minimum), notMoreThan( property, maximum));
    }
351220
public Expression<Short> between(Short startValue, Short endValue) {
		String valueString = "'" + startValue + "' AND '" + endValue + "'";
		return new Expression<Short>(this, Operation.between, valueString);
	}
458459
def make_replacement_visitor(find_expression, replace_expression):
    """"""
    def visitor_fn(expression):
        """Return the replacement if this expression matches the expression we're looking for."""
        if expression == find_expression:
            return replace_expression
        else:
            return expression

    return visitor_fn
477807
private Expression parseComparisonExpression() {
    Token token = tokens.lookahead();
    Expression expr;
    switch (token.type) {
      case EQUAL:
        tokens.consume();
        expr = new Equal(parseVersion());
        break;
      case NOT_EQUAL:
        tokens.consume();
        expr = new NotEqual(parseVersion());
        break;
      case GREATER:
        tokens.consume();
        expr = new Greater(parseVersion());
        break;
      case GREATER_EQUAL:
        tokens.consume();
        expr = new GreaterOrEqual(parseVersion());
        break;
      case LESS:
        tokens.consume();
        expr = new Less(parseVersion());
        break;
      case LESS_EQUAL:
        tokens.consume();
        expr = new LessOrEqual(parseVersion());
        break;
      default:
        expr = new Equal(parseVersion());
    }
    return expr;
  }
421649
public Expression<Double> between(Double startValue, Double endValue) {
		String valueString = "'" + startValue + "' AND '" + endValue + "'";
		return new Expression<Double>(this, Operation.between, valueString);
	}
604409
public Expression<Float> between(Float startValue, Float endValue) {
		String valueString = "'" + startValue + "' AND '" + endValue + "'";
		return new Expression<Float>(this, Operation.between, valueString);
	}
1236542
public Expression<String> between(String startValue, String endValue) {
		String valueString = "'" + startValue + "' AND '" + endValue + "'";
		return new Expression<String>(this, Operation.between, valueString);
	}
652195
public static Between betweenExclusive( String property, int minimum, int maximum)
    {
    return new Between( moreThan( property, minimum), lessThan( property, maximum));
    }