Returns a type instance method for the given operator, applied
    when the instance appears on the left side of the expression.
352820
def op_left(op):
    
    def method(self, other):
        return op(self.value, value_left(self, other))
    return method
39332
@SuppressWarnings("unchecked")
    public static <T> Operation<T> operation(Class<? extends T> type, Operator operator,
                                             ImmutableList<Expression<?>> args) {
        if (type.equals(Boolean.class)) {
            return (Operation<T>) new PredicateOperation(operator, args);
        } else {
            return new OperationImpl<T>(type, operator, args);
        }
    }
1240929
function (operator, field) {
            if (!this.query.where) {
                return null;
            }

            function findExpression(expressions) {
                var expression,
                    ret = null;
                for (var i = 0; i < expressions.length; i++) {
                    expression = expressions[i];
                    if (expression instanceof Where) {
                        ret = findExpression(expression.expressions);
                    } else if (expression instanceof Comparator) {
                        if (expression.operator == operator && expression.field == field) {
                            ret = expression;
                        }
                    }
                    if (ret) {
                        return ret;
                    }

                }
                return ret;
            }

            return findExpression(this.query.where.expressions);
        }
645373
def unary_operator(op):
    
    # Only negate is currently supported.
    valid_ops = {'-'}
    if op not in valid_ops:
        raise ValueError("Invalid unary operator %s." % op)

    @with_doc("Unary Operator: '%s'" % op)
    @with_name(unary_op_name(op))
    def unary_operator(self):
        if self.dtype != float64_dtype:
            raise TypeError(
                "Can't apply unary operator {op!r} to instance of "
                "{typename!r} with dtype {dtypename!r}.\n"
                "{op!r} is only supported for Factors of dtype "
                "'float64'.".format(
                    op=op,
                    typename=type(self).__name__,
                    dtypename=self.dtype.name,
                )
            )

        # This can't be hoisted up a scope because the types returned by
        # unary_op_return_type aren't defined when the top-level function is
        # invoked.
        if isinstance(self, NumericalExpression):
            return NumExprFactor(
                "{op}({expr})".format(op=op, expr=self._expr),
                self.inputs,
                dtype=float64_dtype,
            )
        else:
            return NumExprFactor(
                "{op}x_0".format(op=op),
                (self,),
                dtype=float64_dtype,
            )
    return unary_operator
645929
protected final CALC operator(Class<? extends Operator> operator, Object value) {
        Num tmp = null;
        if (value instanceof Num)
            tmp = (Num)value;
        else
            tmp = new Num(value);
        
        infix.add(CacheExtension.getOperator(operator));
        infix.add(tmp);
        return getThis();
    }
1119451
def SetOperator(self, operator):
    """"""
    self.operator = operator
    # Find the appropriate list of operators for this attribute
    attribute_type = self.attribute_obj.GetRDFValueType()
    operators = attribute_type.operators

    # Do we have such an operator?
    self.number_of_args, self.operator_method = operators.get(
        operator, (0, None))

    if self.operator_method is None:
      raise lexer.ParseError("Operator %s not defined on attribute '%s'" %
                             (operator, self.attribute))

    self.operator_method = getattr(attribute_type, self.operator_method)
535345
def method_missing(method_name, *args)
      # Find the operator class
      class_name = method_name.to_s.camelcase
      operator_class = "Fleximage::Operator::#{class_name}".constantize
      
      # Define a method for this operator so future calls to this operation are faster
      self.class.module_eval <<-EOF
        def #{method_name}(*args)
          @image = execute_operator(#{operator_class}, *args)
        end
      EOF
      
      # Call the method that was just defined to perform its functionality.
      send(method_name, *args)
    
    rescue NameError => e
      if e.to_s =~ /uninitialized constant Fleximage::Operator::#{class_name}/
        raise OperatorNotFound, "No operator Fleximage::Operator::#{class_name} found for the method \"#{method_name}\""
      else
        raise e
      end
    end
843654
def unary_operator(op):
    
    valid_ops = {'~'}
    if op not in valid_ops:
        raise ValueError("Invalid unary operator %s." % op)

    def unary_operator(self):
        # This can't be hoisted up a scope because the types returned by
        # unary_op_return_type aren't defined when the top-level function is
        # invoked.
        if isinstance(self, NumericalExpression):
            return NumExprFilter.create(
                "{op}({expr})".format(op=op, expr=self._expr),
                self.inputs,
            )
        else:
            return NumExprFilter.create("{op}x_0".format(op=op), (self,))

    unary_operator.__doc__ = "Unary Operator: '%s'" % op
    return unary_operator
678477
def declare_local_operator(self, type, raw_model=None):
        '''
        
        '''
        onnx_name = self.get_unique_operator_name(str(type))
        operator = Operator(onnx_name, self.name, type, raw_model, self.target_opset)
        self.operators[onnx_name] = operator
        return operator
957482
public static <T extends Comparable<?>> ComparableOperation<T> comparableOperation(Class<? extends T> type,
            Operator operator, Expression<?>... args) {
        return new ComparableOperation<T>(type, operator, args);
    }
668770
public static <T extends Number & Comparable<?>> NumberOperation<T> numberOperation(Class<? extends T> type,
            Operator operator, Expression<?>... args) {
        return new NumberOperation<T>(type, operator, args);
    }
800814
public static TerminalOp<Double, OptionalDouble>
    makeDouble(DoubleBinaryOperator operator) {
        Objects.requireNonNull(operator);
        class ReducingSink
                implements AccumulatingSink<Double, OptionalDouble, ReducingSink>, Sink.OfDouble {
            private boolean empty;
            private double state;

            public void begin(long size) {
                empty = true;
                state = 0;
            }

            @Override
            public void accept(double t) {
                if (empty) {
                    empty = false;
                    state = t;
                }
                else {
                    state = operator.applyAsDouble(state, t);
                }
            }

            @Override
            public OptionalDouble get() {
                return empty ? OptionalDouble.empty() : OptionalDouble.of(state);
            }

            @Override
            public void combine(ReducingSink other) {
                if (!other.empty)
                    accept(other.state);
            }
        }
        return new ReduceOp<Double, OptionalDouble, ReducingSink>(StreamShape.DOUBLE_VALUE) {
            @Override
            public ReducingSink makeSink() {
                return new ReducingSink();
            }
        };
    }
943337
public static function getOperator($type, $operator)
    {
        $operators = self::getOperators($type);

        return Arr::get($operators, $operator, []);
    }
755272
def validate_class_type_arguments(operator):
    

    def inner(function):

        def wrapper(self, *args, **kwargs):
            for arg in args + tuple(kwargs.values()):
                if not isinstance(arg, self.__class__):
                    raise TypeError(
                        'unorderable types: {}() {} {}()'.format(
                            type(self).__name__, operator, type(arg).__name__
                        )
                    )

            return function(self, *args, **kwargs)

        return wrapper

    return inner
434442
def has_public_binary_operator(type_, operator_symbol):
    """"""
    type_ = type_traits.remove_alias(type_)
    type_ = type_traits.remove_cv(type_)
    type_ = type_traits.remove_declarated(type_)
    assert isinstance(type_, class_declaration.class_t)

    if type_traits.is_std_string(type_) or type_traits.is_std_wstring(type_):
        # In some case compare operators of std::basic_string are not
        # instantiated
        return True

    operators = type_.member_operators(
        function=matchers.custom_matcher_t(
            lambda decl: not decl.is_artificial) &
        matchers.access_type_matcher_t('public'),
        symbol=operator_symbol, allow_empty=True, recursive=False)
    if operators:
        return True

    declarated = cpptypes.declarated_t(type_)
    const = cpptypes.const_t(declarated)
    reference = cpptypes.reference_t(const)
    operators = type_.top_parent.operators(
        function=lambda decl: not decl.is_artificial,
        arg_types=[reference, None],
        symbol=operator_symbol,
        allow_empty=True,
        recursive=True)
    if operators:
        return True
    for bi in type_.recursive_bases:
        assert isinstance(bi, class_declaration.hierarchy_info_t)
        if bi.access_type != class_declaration.ACCESS_TYPES.PUBLIC:
            continue
        operators = bi.related_class.member_operators(
            function=matchers.custom_matcher_t(
                lambda decl: not decl.is_artificial) &
            matchers.access_type_matcher_t('public'),
            symbol=operator_symbol, allow_empty=True, recursive=False)
        if operators:
            return True
    return False
1173824
public static ExprBoolean toExprBoolean(Expression left, Expression right, int operation) {
	if (left instanceof Literal && right instanceof Literal) {
	    Boolean l = ((Literal) left).getBoolean(null);
	    Boolean r = ((Literal) right).getBoolean(null);

	    if (l != null && r != null) {
		switch (operation) {
		case Factory.OP_BOOL_AND:
		    return left.getFactory().createLitBoolean(l.booleanValue() && r.booleanValue(), left.getStart(), right.getEnd());
		case Factory.OP_BOOL_OR:
		    return left.getFactory().createLitBoolean(l.booleanValue() || r.booleanValue(), left.getStart(), right.getEnd());
		case Factory.OP_BOOL_XOR:
		    return left.getFactory().createLitBoolean(l.booleanValue() ^ r.booleanValue(), left.getStart(), right.getEnd());
		}
	    }
	}
	return new OpBool(left, right, operation);
    }
897986
def operatorLabel( self, operator ):
        
        for key, value in self._operatorMap.items():
            if ( value == operator ):
                return key
        return operator