some where conditions eg. 1=1 or 3>2 or 'a'='b'
13551
private boolean explanSpecialCondWithBothSidesAreLiterals(SQLBinaryOpExpr bExpr, Where where) throws SqlParseException {
        if ((bExpr.getLeft() instanceof SQLNumericLiteralExpr || bExpr.getLeft() instanceof SQLCharExpr) &&
                (bExpr.getRight() instanceof SQLNumericLiteralExpr || bExpr.getRight() instanceof SQLCharExpr)
                ) {
            SQLMethodInvokeExpr sqlMethodInvokeExpr = new SQLMethodInvokeExpr("script", null);
            String operator = bExpr.getOperator().getName();
            if (operator.equals("=")) {
                operator = "==";
            }
            sqlMethodInvokeExpr.addParameter(
                    new SQLCharExpr(Util.expr2Object(bExpr.getLeft(), "'") +
                            " " + operator + " " +
                            Util.expr2Object(bExpr.getRight(), "'"))
            );

            explanCond("AND", sqlMethodInvokeExpr, where);
            return true;
        }
        return false;
    }
155094
def check(a, b):
    
    aencrypt = encrypt(a)
    bencrypt = encrypt(b)

    return a == b or a == bencrypt or aencrypt == b
977527
def logical_or(self, other):
        """"""
        return self.operation(other, lambda x, y: int(x or y))
268420
def p_expression_Or(self, p):
        ''
        p[0] = Or(p[1], p[3], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))
688565
function generateWhereClause(constraints, queryValues = []) {
  if (!constraints.length) {
    return {
      queryValues,
      whereClause: ''
    }
  }

  if (constraints.length === 1) {
    return {
      queryValues,
      whereClause: ' WHERE ' + generateSqlKeyVals(' AND ', constraints[0], queryValues, true)
    }
  }

  const whereClause = ' WHERE ' + constraints
    .map(constr => {
      return `(${generateSqlKeyVals(' AND ', constr, queryValues, true)})`
    })
    .join(' OR ')

  return {
    queryValues,
    whereClause
  }
}
348444
function(a, b)
	{
		if ((a == null && b != null) || (a != null && b == null) ||
			(a != null && b != null && a.length != b.length))
		{
			return false;
		}
		else if (a != null && b != null)
		{
			for (var i = 0; i < a.length; i++)
			{
				if (a[i] == b[i] || (a[i] != null && !a[i].equals(b[i])))
				{
					return false;
				}
			}
		}
		
		return true;
	}
965412
def conditions(self):
        
        return operatorPrecedence(
            baseExpr=self.condition,
            opList=[(self.not_op, 1, opAssoc.RIGHT),
                    (self.logical_binary_op, 2, opAssoc.LEFT)],
            lpar=self.syntax.paren_left,
            rpar=self.syntax.paren_right)
302120
private static boolean leq(int a1, int a2, int b1, int b2) {
        return (a1 < b1 || (a1 == b1 && a2 <= b2));
    }
1221779
def where(self, field, value = None, operator = None):
        
        if field is None:
            return self
        conjunction = None
        if value is None and isinstance(field, dict):
            for f,v in field.items():
                if self.where_criteria.size() > 0:
                    conjunction = 'AND'
                self.where_criteria.append(expressions.ConditionExpression(f, v, operator=operator, conjunction=conjunction))
                
        else:
            if self.where_criteria.size() > 0:
                    conjunction = 'AND'
            self.where_criteria.append(expressions.ConditionExpression(field, value, operator=operator, conjunction=conjunction))
        return self
166522
function checkCondition(i) {
  const start = i;
  let l;
  let _i;
  let s;

  if (i >= tokensLength) return 0;

  if (l = checkAtkeyword(i)) i += l;
  else return 0;

  if (['if', 'else'].indexOf(tokens[start + 1].value) < 0) return 0;

  while (i < tokensLength) {
    if (l = checkBlock(i)) break;

    s = checkSC(i);
    _i = i + s;

    if (l = _checkCondition(_i)) i += l + s;
    else break;
  }

  return i - start;
}
1076329
function where (expr, operator) {
    if (this.typecheck) t.typecheck('where', [expr, operator]);
    if ('string'===typeof expr) return 'where '+expr;
    return 'where ' + expr.join(' '+(operator||'and')+' ');
}
756833
function(a, b) {
       if (typeof a != typeof b) return
       if (a === b) return true
       if (a instanceof RegExp)
         return a.toString() === b.toString()
       if (a instanceof Date)
         return Number(a) === Number(b)
       if (typeof a != 'object') return
       if (a.length !== undefined)
         if (a.length !== b.length) return
         else
           for (var i = 0, len = a.length; i < len; ++i)
             if (!equal(a[i], b[i]))
               return
       for (var key in a)
         if (!equal(a[key], b[key]))
           return
       return true
     }
647179
function _filter (node, expr, resultSet) {
        var
            selectedNodes,
            conditions,
            type,
            idx,
            condition;
        if (expr.and) {
            conditions = expr.and;
            type = 0;
        } else if (expr.or) {
            conditions = expr.or;
            type = 1;
        }
        for (idx = 0; idx < conditions.length; ++idx) {
            condition = conditions[idx];
            if (condition.and || condition.or) {
                selectedNodes = [];
                _filter(node, condition, selectedNodes);
            } else {
                selectedNodes = _select(node, condition);
            }
            if (0 === type && selectedNodes.length === 0) {
                return;
            }
            if (1 === type && selectedNodes.length !== 0) {
                resultSet.push(node);
                return;
            }
        }
        if (0 === type) {
            resultSet.push(node);
        }
    }
642531
function _validate_row_conditions ($row = array(), $conditions = null) {
		if ( !empty($row) ) {
			if ( !empty($conditions) ) {
				$conditions = (strpos($conditions, ' OR ') !== false) ? explode(' OR ', $conditions) : array($conditions) ;
				$or = '';
				foreach( $conditions as $key => $value ) {
					if ( strpos($value, ' AND ') !== false ) {
						$value = explode(' AND ', $value);
						$and = '';
						foreach( $value as $k => $v ) {
							$and .= $this->_validate_row_condition($row, $v);
						}
						$or .= (strpos($and, '0') !== false) ? '0' : '1' ;
					} else {
						$or .= $this->_validate_row_condition($row, $value);
					}
				}
				return (strpos($or, '1') !== false) ? true : false ;
			}
			return true;
		}
		return false;
	}
109131
def BETWEEN(a, b):
    
    if any((isinstance(x, ConditionalElement) for x in (a, b))):
        raise TypeError(
            "A ConditionalElement can't be used as an operator condition.")
    else:
        return P(lambda x: a <= x <= b)
255589
function(or, and) {
			var aDiff = set.difference(or, and.values[0]);
			var bDiff = set.difference(or, and.values[1]);
			return set.union(aDiff, bDiff);
		}
899487
function(a, b)
{
    return (a.bb_l <= b.bb_r && b.bb_l <= a.bb_r && a.bb_b <= b.bb_t && b.bb_b <= a.bb_t);
}