Returns True if conditional constructed from both operands and
        self.operator is valid. Returns False otherwise.
481401
def compare_operands(self, p_operand1, p_operand2):
        
        if self.operator == '<':
            return p_operand1 < p_operand2
        elif self.operator == '<=':
            return p_operand1 <= p_operand2
        elif self.operator == '=':
            return p_operand1 == p_operand2
        elif self.operator == '>=':
            return p_operand1 >= p_operand2
        elif self.operator == '>':
            return p_operand1 > p_operand2
        elif self.operator == '!':
            return p_operand1 != p_operand2

        return False
884599
def operator(self):
        
        operators = (self.op, self.op + '_', '__' + self.op + '__')

        for op in operators:
            if hasattr(self.column, op):
                return op

        raise InvalidFilters("{} has no operator {}".format(self.column.key, self.op))
1256513
def check_condition(condition, defined_variables):
    
    name, op, value = condition['name'], condition['operator'], condition['value']
    operator_type = _get_variable_value(defined_variables, name)
    return _do_operator_comparison(operator_type, op, value)
995332
function checkForDisallowedESSymbolOperand(operator) {
                var offendingSymbolOperand = maybeTypeOfKind(leftType, 512 /* ESSymbol */) ? left :
                    maybeTypeOfKind(rightType, 512 /* ESSymbol */) ? right :
                        undefined;
                if (offendingSymbolOperand) {
                    error(offendingSymbolOperand, ts.Diagnostics.The_0_operator_cannot_be_applied_to_type_symbol, ts.tokenToString(operator));
                    return false;
                }
                return true;
            }
535531
protected function checkOperand($operand)
    {
        if (!is_scalar($operand) && !$operand instanceof ExpressionContract) {
            throw new InvalidArgumentException('Condition only acceps scalars and Expression, not ' . Type::of($operand));
        }
        return $operand;
    }
698568
def is_valid(cls, arg):
        """"""
        if isinstance(arg, list):
            allInts = allStrings = True
            for elem in arg:
                allInts = allInts and ((elem == 0) or (elem == 1))
                allStrings = allStrings and elem in cls.bitNames

            if allInts or allStrings:
                return True
        return False
466697
def _is_bounded_iterator_based(self):
        

        # Condition 0
        check_0 = lambda cond: (isinstance(cond, Condition) and
                                cond.op == Condition.Equal and
                                cond.val1 == 0 and
                                isinstance(cond.val0, AnnotatedVariable) and
                                cond.val0.type == VariableTypes.HasNext
                                )

        check_0_results = [ (check_0(stmt[0]), stmt[0]) for stmt in self.loop_exit_stmts ]
        check_0_conds = [ cond for r, cond in check_0_results if r ]  # remove all False ones

        if not check_0_conds:
            return None

        the_iterator = check_0_conds[0].val0.variable

        # Condition 1
        check_1 = lambda local: (isinstance(local, AnnotatedVariable) and
                                 local.type == VariableTypes.Next and
                                 local.variable == the_iterator
                                 )

        if not any([ check_1(local) for local in self.locals.values() ]):
            return None

        return True
127032
def operator_is(u):
    """"""
    global _aux
    if np.ndim(u) == 2:
        P = _P2
    elif np.ndim(u) == 3:
        P = _P3
    else:
        raise ValueError("u has an invalid number of dimensions "
                         "(should be 2 or 3)")
    
    if u.shape != _aux.shape[1:]:
        _aux = np.zeros((len(P),) + u.shape)
    
    for _aux_i, P_i in zip(_aux, P):
        _aux_i[:] = binary_dilation(u, P_i)
    
    return _aux.min(0)
57867
@Pure
	@Inline(value="(!$3.equal($1, $2))", imported=Objects.class)
	public static boolean operator_notEquals(Object a, Object b) {
		return !Objects.equal(a, b);
	}
1228808
static public BooleanExpression NOT(BooleanExpression operand){
		BooleanExpression result = new BooleanExpression(OPERATOR_NOT);
		result.addOperand(operand);
		return result;
	}
168906
public boolean hasState() {
		for (OperatorSubtaskState operatorSubtaskState : subtaskStatesByOperatorID.values()) {
			if (operatorSubtaskState != null && operatorSubtaskState.hasState()) {
				return true;
			}
		}
		return false;
	}
971876
@Pure
	@Inline(value = "($1 != null && ($1.shortValue() == $2))", constantExpression = true)
	public static boolean operator_equals(Short left, long right) {
		return left != null ? left.shortValue() == right : false;
	}
1241279
def is_valid(cls, arg):
        
        return (isinstance(arg, (int, long)) and (arg >= 0)) or \
            isinstance(arg, basestring)
46309
public boolean evaluate(Object context){
		switch (operatorType){
		case OPERATOR_AND:
			for (BooleanExpression e: children){
				if (e.evaluate(context) == false){
					return false;
				}
			}
			return true;
		case OPERATOR_OR:
			for (BooleanExpression e: children){
				if (e.evaluate(context) == true){
					return true;
				}
			}
			return false;
		case OPERATOR_NOT:
			if (children.size() != 1){
				throw new UnsupportedOperationException("One and only one operand is allowed for NOT operator.");
			}
			BooleanExpression e = children.get(0);
			return !e.evaluate(context);
		default:
			throw new UnsupportedOperationException("Operand should implement its own evaluation method.");
		}
	}
1090896
def issorted(list_, op=operator.le):
    
    return all(op(list_[ix], list_[ix + 1]) for ix in range(len(list_) - 1))
855383
private static Set<Kind> validateOperators(Set<Kind> kinds) {
    for (Kind kind : kinds) {
      if (!COMPOUND_ASSIGNMENT_OPERATORS.contains(kind)) {
        throw new IllegalArgumentException(kind.name() + " is not a compound-assignment operator.");
      }
    }
    return kinds;
  }
104947
static public BooleanExpression AND(BooleanExpression... operands){
		BooleanExpression result = new BooleanExpression(OPERATOR_AND);
		result.addOperand(operands);
		return result;
	}