Visitor for `BinaryOperation` AST node.
429847
def visit_BinaryOperation(self, node):
        """"""
        if node.op.nature == Nature.PLUS:
            return self.visit(node.left) + self.visit(node.right)
        elif node.op.nature == Nature.MINUS:
            return self.visit(node.left) - self.visit(node.right)
        elif node.op.nature == Nature.MUL:
            return self.visit(node.left) * self.visit(node.right)
        elif node.op.nature == Nature.DIV:
            return self.visit(node.left) / self.visit(node.right)
        elif node.op.nature == Nature.INT_DIV:
            return self.visit(node.left) // self.visit(node.right)
        elif node.op.nature == Nature.EQ:
            return self.visit(node.left) == self.visit(node.right)
        elif node.op.nature == Nature.NE:
            return self.visit(node.left) != self.visit(node.right)
        elif node.op.nature == Nature.LE:
            return self.visit(node.left) <= self.visit(node.right)
        elif node.op.nature == Nature.GE:
            return self.visit(node.left) >= self.visit(node.right)
        elif node.op.nature == Nature.LT:
            return self.visit(node.left) < self.visit(node.right)
        elif node.op.nature == Nature.GT:
            return self.visit(node.left) > self.visit(node.right)
        elif node.op.nature == Nature.OR:
            return self.visit(node.left) or self.visit(node.right)
        elif node.op.nature == Nature.AND:
            return self.visit(node.left) and self.visit(node.right)
669352
def _bin_op(instance, opnode, op, other, context, reverse=False):
    
    if reverse:
        method_name = protocols.REFLECTED_BIN_OP_METHOD[op]
    else:
        method_name = protocols.BIN_OP_METHOD[op]
    return functools.partial(
        _invoke_binop_inference,
        instance=instance,
        op=op,
        opnode=opnode,
        other=other,
        context=context,
        method_name=method_name,
    )
60153
def _process_binary_trigger(trigger_value, condition):
    """"""

    ops = {
        0: ">",
        1: "<",
        2: ">=",
        3: "<=",
        4: "==",
        5: 'always'
    }

    sources = {
        0: 'value',
        1: 'count'
    }

    encoded_source = condition & 0b1
    encoded_op = condition >> 1

    oper = ops.get(encoded_op, None)
    source = sources.get(encoded_source, None)

    if oper is None:
        raise ArgumentError("Unknown operation in binary trigger", condition=condition, operation=encoded_op, known_ops=ops)
    if source is None:
        raise ArgumentError("Unknown value source in binary trigger", source=source, known_sources=sources)

    if oper == 'always':
        return TrueTrigger()

    return InputTrigger(source, oper, trigger_value)
533287
@Nonnull
	public static <T> LBinaryOperatorBuilder<T> binaryOperator(Consumer<LBinaryOperator<T>> consumer) {
		return new LBinaryOperatorBuilder(consumer);
	}
366899
function isPlusPlusUnaryOperation (node) {
  return nodeType(node, exactMatch(nodeTypes.UNARYOPERATION)) && operator(node, exactMatch(util.escapeRegExp('++')))
}
235202
def binary_operation_logical(self, rule, left, right, **kwargs):
        
        return self.evaluate_binop_logical(rule.operation, left, right, **kwargs)
547387
def make_binary(lineno, operator, left, right, func=None, type_=None):
    
    return symbols.BINARY.make_node(operator, left, right, lineno, func, type_)
107891
def isbinary(*args):
    """"""
    return all(map(lambda c: isnumber(c) or isbool(c), args))
886681
def _infer_binary_operation(left, right, binary_opnode, context, flow_factory):
    

    context, reverse_context = _get_binop_contexts(context, left, right)
    left_type = helpers.object_type(left)
    right_type = helpers.object_type(right)
    methods = flow_factory(
        left, left_type, binary_opnode, right, right_type, context, reverse_context
    )
    for method in methods:
        try:
            results = list(method())
        except AttributeError:
            continue
        except exceptions.AttributeInferenceError:
            continue
        except exceptions.InferenceError:
            yield util.Uninferable
            return
        else:
            if any(result is util.Uninferable for result in results):
                yield util.Uninferable
                return

            if all(map(_is_not_implemented, results)):
                continue
            not_implemented = sum(
                1 for result in results if _is_not_implemented(result)
            )
            if not_implemented and not_implemented != len(results):
                # Can't infer yet what this is.
                yield util.Uninferable
                return

            yield from results
            return
    # The operation doesn't seem to be supported so let the caller know about it
    yield util.BadBinaryOperationMessage(left_type, binary_opnode.op, right_type)
526215
function checkUnaryUpdate(node) {
            if (node.type === "UnaryExpression" && node.argument.type === "BinaryExpression" && node.argument.operator === "**") {
                return;
            }

            if (hasExcessParens(node.argument) && precedence(node.argument) >= precedence(node)) {
                report(node.argument);
            }
        }
957067
private FieldTextBuilder binaryOperation(final String operator, final FieldText fieldText) {
        // This should never happen as the AND, OR, XOR and WHEN methods should already have checked this
        Validate.isTrue(fieldText != this);

        // Optimized case when fieldText is a FieldTextBuilder
        if(fieldText instanceof FieldTextBuilder) {
            return binaryOp(operator, (FieldTextBuilder)fieldText);
        }

        // Special case when we're empty
        if(componentCount == 0) {
            fieldTextString.append(fieldText.toString());

            if(fieldText.size() > 1) {
                lastOperator = "";
            }
        } else {
            // Add the NOTs, parentheses and operator
            addOperator(operator);

            // Size 1 means a single specifier, so no parentheses
            if(fieldText.size() == 1) {
                fieldTextString.append(fieldText.toString());
            } else {
                fieldTextString.append('(').append(fieldText.toString()).append(')');
            }
        }

        componentCount += fieldText.size();
        not = false;

        return this;
    }
731973
def BinaryOperator(self, string=None, **unused_kwargs):
    """"""
    self.stack.append(self.binary_expression_cls(string))
1188534
def visit_BinOp(self, node: AST, dfltChaining: bool = True) -> str:
        """"""
        op = node.op
        with self.op_man(op):
            if isinstance(op, ast.Pow):
                # Pow chains right-to-left
                src = self.visit(op).join((self.visit(node.left,
                                                      dfltChaining=False),
                                           self.visit(node.right)))
            else:
                src = self.visit(op).join((self.visit(node.left),
                                           self.visit(node.right,
                                                      dfltChaining=False)))
            return self.wrap_expr(src, dfltChaining)
617632
def is_binary_operator(oper):
    """"""
    # definition:
    # member in class
    # ret-type operator symbol(arg)
    # globally
    # ret-type operator symbol( arg1, arg2 )
    symbols = [
        ',', '()', '[]', '!=', '%', '%=', '&', '&&', '&=', '*', '*=', '+',
        '+=', '-', '-=', '->', '->*', '/', '/=', '<', '<<', '<<=', '<=', '=',
        '==', '>', '>=', '>>', '>>=', '^', '^=', '|', '|=', '||']
    if not isinstance(oper, calldef_members.operator_t):
        return False
    if oper.symbol not in symbols:
        return False

    if isinstance(oper, calldef_members.member_operator_t):
        if len(oper.arguments) == 1:
            return True
        return False

    if len(oper.arguments) == 2:
        return True
    return False
479406
def visit_BoolOp(self, node: ast.BoolOp) -> Any:
        """"""
        values = [self.visit(value_node) for value_node in node.values]

        if isinstance(node.op, ast.And):
            result = functools.reduce(lambda left, right: left and right, values, True)
        elif isinstance(node.op, ast.Or):
            result = functools.reduce(lambda left, right: left or right, values, True)
        else:
            raise NotImplementedError("Unhandled op of {}: {}".format(node, node.op))

        self.recomputed_values[node] = result
        return result
735807
static Object longBinaryOperation(long lhs, long rhs, int kind)
    {
        switch(kind)
        {
            // arithmetic
            case PLUS:
                if ( lhs > 0 && (Long.MAX_VALUE - lhs) < rhs )
                    break;
                return lhs + rhs;

            case MINUS:
                if ( lhs < 0 && (Long.MIN_VALUE - lhs) > -rhs )
                    break;
                return lhs - rhs;

            case STAR:
                if ( lhs != 0 && Long.MAX_VALUE / lhs < rhs )
                    break;
                return lhs * rhs;

            case SLASH:
                return lhs / rhs;

            case MOD:
            case MODX:
                return lhs % rhs;

            case POWER:
            case POWERX:
                double check = Math.pow(lhs, rhs);
                BigInteger bi = BigDecimal.valueOf(check).toBigInteger();
                if ( bi.compareTo(Primitive.LONG_MIN) >= 0 && bi.compareTo(Primitive.LONG_MAX) <= 0 )
                    return (long) check;
                break;

            // bitwise
            case LSHIFT:
            case LSHIFTX:
                return lhs << rhs;

            case RSIGNEDSHIFT:
            case RSIGNEDSHIFTX:
                return lhs >> rhs;

            case RUNSIGNEDSHIFT:
            case RUNSIGNEDSHIFTX:
                return lhs >>> rhs;

            case BIT_AND:
            case BIT_ANDX:
                return lhs & rhs;

            case BIT_OR:
            case BIT_ORX:
                return lhs | rhs;

            case XOR:
            case XORX:
                return lhs ^ rhs;

        }
        if ( OVERFLOW_OPS.contains(kind) )
            return bigIntegerBinaryOperation(BigInteger.valueOf(lhs), BigInteger.valueOf(rhs), kind);

        throw new InterpreterError(
                "Unimplemented binary long operator");
    }
400369
def _eval_unaryop(self, node):
        
        return self.operators[type(node.op)](self._eval(node.operand))