Returned expression results in NaN if expression1 = expression2, otherwise returns expression1.
Returns MISSING or NULL if either input is MISSING or NULL.
327909
public static Expression nanIf(Expression expression1, Expression expression2) {
        return x("NANIF(" + expression1.toString() + ", " + expression2.toString() + ")");
    }
406540
def Nand(*xs, simplify=True):
    
    xs = [Expression.box(x).node for x in xs]
    y = exprnode.not_(exprnode.and_(*xs))
    if simplify:
        y = y.simplify()
    return _expr(y)
904548
@Override
  public Double add22(Double arg1, Double arg2) {
    if (arg1 == null || arg2 == null) {
      return Double.NaN;
    } else {
      return arg1 + arg2;
    }
  }
47412
public static boolean areStringEquals(String string1, String string2) {
		/* string1	string2	outcome
		 * null		null	true
		 * null		x		false
		 * x		null	false
		 * x		y		false
		 * x		x		true
		 */
		// XXX both null must be unequal? If yes, boolean must be too?
		if (string1 == null && string2 == null) {
			return false;
		} else if (string1 != null && !string1.equals(string2)) {
			return false;
		} else if (string2 != null && !string2.equals(string1)) {
			return false;
		}
		return true;
	}
1304231
public static Expression nullIf(Expression expression1, Expression expression2) {
        return x("NULLIF(" + expression1.toString() + ", " + expression2.toString() + ")");
    }
630855
def visitComparisonExpression(self, ctx):
        
        arg1, arg2 = conversions.to_same(self.visit(ctx.expression(0)), self.visit(ctx.expression(1)), self._eval_context)

        if isinstance(arg1, str):
            # string comparison is case-insensitive
            compared = (arg1.lower() > arg2.lower()) - (arg1.lower() < arg2.lower())
        else:
            compared = (arg1 > arg2) - (arg1 < arg2)

        if ctx.LTE() is not None:
            return compared <= 0
        elif ctx.LT() is not None:
            return compared < 0
        elif ctx.GTE() is not None:
            return compared >= 0
        else:  # GT
            return compared > 0
603239
function (v) {
                            return ((v === undefined) ||
                                    (v === null) ||
                                    (v === Math.NaN) ||
                                    (v === '') ||
                                    (_.isPOD (v) &&
                                        (_.isEmptyObject (v) ||
                                        (v.length === 0)))) ? undefined : v }
31331
private String checkInputParameter(Expression expression)
    {
        return (expression instanceof InputParameter) ? kunderaQuery.getParametersMap()
                .get((expression).toParsedText()).toString() : expression.toParsedText().toString();
    }
929750
def Contradiction(expr1: Expression, expr2: Expression) -> Expression:
    """"""
    expr = Disjunction(Conjunction(expr1, Negation(expr2)),
                       Conjunction(Negation(expr1), expr2))
    return ast.fix_missing_locations(expr)
564643
function (a, b) {
                        var result = 0,
                            sumA = sum(a),
                            sumB = sum(b);
                        if (!isNaN(sumA) && sumA !== 0 && !isNaN(sumB) && sumB !== 0) {
                            result = parseFloat(sumA) - parseFloat(sumB);
                        } else if (!isNaN(Date.parse(a[0])) && !isNaN(Date.parse(b[0]))) {
                            result = Date.parse(a[0]) - Date.parse(b[0]);
                        } else if (a[0] < b[0]) {
                            result = -1;
                        } else if (a[0] > b[0]) {
                            result = 1;
                        }
                        return result;
                    }
827924
def eq(self, other):
        
        # We treat this as an error because missing_values have NaN semantics,
        # which means this would return an array of all False, which is almost
        # certainly not what the user wants.
        if other == self.missing_value:
            raise ValueError(
                "Comparison against self.missing_value ({value!r}) in"
                " {typename}.eq().\n"
                "Missing values have NaN semantics, so the "
                "requested comparison would always produce False.\n"
                "Use the isnull() method to check for missing values.".format(
                    value=other,
                    typename=(type(self).__name__),
                )
            )

        if isinstance(other, Number) != (self.dtype == int64_dtype):
            raise InvalidClassifierComparison(self, other)

        if isinstance(other, Number):
            return NumExprFilter.create(
                "x_0 == {other}".format(other=int(other)),
                binds=(self,),
            )
        else:
            return ArrayPredicate(
                term=self,
                op=operator.eq,
                opargs=(other,),
            )
577979
def _get_val(other):
    
    assert isinstance(other, (numbers.Number, SymbolNUMBER, SymbolCONST))
    if isinstance(other, SymbolNUMBER):
        return other.value

    if isinstance(other, SymbolCONST):
        return other.expr.value

    return other
708347
private static Expression doEqualsString(SoyExpression stringExpr, SoyExpression other) {
    // This is compatible with SharedRuntime.compareString, which interestingly makes == break
    // transitivity.  See b/21461181
    SoyRuntimeType otherRuntimeType = other.soyRuntimeType();
    if (otherRuntimeType.isKnownStringOrSanitizedContent()) {
      if (stringExpr.isNonNullable()) {
        return stringExpr.invoke(MethodRef.EQUALS, other.unboxAsString());
      } else {
        return MethodRef.OBJECTS_EQUALS.invoke(stringExpr, other.unboxAsString());
      }
    }
    if (otherRuntimeType.isKnownNumber() && other.isNonNullable()) {
      // in this case, we actually try to convert stringExpr to a number
      return MethodRef.RUNTIME_STRING_EQUALS_AS_NUMBER.invoke(stringExpr, other.coerceToDouble());
    }
    // We don't know what other is, assume the worst and call out to our boxed implementation for
    // string comparisons.
    return MethodRef.RUNTIME_COMPARE_NULLABLE_STRING.invoke(stringExpr, other.box());
  }
768616
def evaluate_condition(condition, vars):
    ''''''
    if condition is None:
        return True
    v = evaluate_expression(condition, vars)
    if v is None:
        return False
    return v
266014
public BooleanExpression isNull() {
        if (isnull == null) {
            isnull = Expressions.booleanOperation(Ops.IS_NULL, mixin);
        }
        return isnull;
    }
578975
static boolean isExpression(String expression) {

        if (null == expression) {
            return false;
        }

        //check to see if attribute has an expression
        int start = expression.indexOf("#{");
        return start != -1 && expression.indexOf('}', start+2) != -1;
    }
360248
def p_expression_unand(self, p):
        ''
        p[0] = Unand(p[2], lineno=p.lineno(1))
        p.set_lineno(0, p.lineno(1))