Modifies the left and right sides of an equation by `op`-ing `term` to both sides. Returns an Status object.
773191
function performTermOperationOnEquation(equation, op, term, changeType) {
  const oldEquation = equation.clone();

  const leftTerm = clone(term);
  const rightTerm = clone(term);
  const leftNode = performTermOperationOnExpression(
    equation.leftNode, op, leftTerm);
  const rightNode = performTermOperationOnExpression(
    equation.rightNode, op, rightTerm);

  let comparator = equation.comparator;
  if (Negative.isNegative(term) && (op === '*' || op === '/')) {
    comparator = COMPARATOR_TO_INVERSE[comparator];
  }

  const newEquation = new Equation(leftNode, rightNode, comparator);
  return new EquationStatus(changeType, oldEquation, newEquation);
}
190340
def conflicting_pairs(left, right):
    """"""
    objects = left._objects & right._objects
    properties = left._properties & right._properties
    difference = left._pairs ^ right._pairs
    for o in objects:
        for p in properties:
            if (o, p) in difference:
                yield (o, p)
340746
function rightTooSmall(node) {
		if (balanceFactor(node) <= 1) { return node; }   // Right is not too small, don't change
		if (balanceFactor(node.left) < 0) {leftRotation(node.left);}
		return rightRotation(node);
	}
1121998
def _scalar_pattern_uniform_op_left(func):
        """"""
        @wraps(func)
        def verif(self, patt):
            if isinstance(patt, ScalarPatternUniform):
                if self._dsphere.shape == patt._dsphere.shape:
                    return ScalarPatternUniform(func(self, self._dsphere,
                                                     patt._dsphere),
                                                doublesphere=True)
                else:
                    raise ValueError(err_msg['SP_sz_msmtch'] % \
                                            (self.nrows, self.ncols,
                                            patt.nrows, patt.ncols))
        
            elif isinstance(patt, numbers.Number):
                return ScalarPatternUniform(func(self, self._dsphere, patt),
                                            doublesphere=True)
            else:
                raise TypeError(err_msg['no_combi_SP'])
        return verif
743061
def right_to_left(self):
        """"""
        self._entry_mode &= ~Command.MODE_INCREMENT
        self.command(self._entry_mode)
196079
def evalop(op,left,right):
  ""
  if op in ('=','!=','>','<'): return threevl.ThreeVL.compare(op,left,right)
  elif op in ('+','-','*','/'): # todo: does arithmetic require threevl?
    if op=='/': raise NotImplementedError('todo: spec about int/float division')
    return (left + right) if op=='+' else (left - right) if op=='-' else (left * right) if op=='*' else (left/right)
  elif op=='in': return (tuple(left) in right) if isinstance(left,list) and isinstance(right[0],tuple) else (left in right)
  elif op in ('and','or'): return threevl.ThreeVL.andor(op,left,right)
  elif op in ('is not','is'):
    if right is not None: raise NotImplementedError('can null be on either side? what if neither value is null?')
    return (left is not None) if (op=='is not') else (left is None)
  elif op=='@>':
    # todo: support a TextSearchDoc that will overload a lot of these operators
    if not all(isinstance(x,list) for x in (left,right)): raise TypeError('non-array-args',op,left,right)
    return set(left)>=set(right)
  elif op=='||':
    if not all(isinstance(x,list) for x in (left,right)): raise TypeError('non-array-args',op,left,right)
    return left+right
  elif op=='@@':
    if not all(isinstance(x,set) for x in (left,right)): raise TypeError('non_set_args',op,type(left),type(right))
    return bool(left&right)
  else: raise NotImplementedError(op,left,right)
1162797
private static <K, N extends Node<K, N>> N balanceLeft(UpdateContext<? super N> currentContext, N node, N left, N right) {
        if (isRed(left) && isRed(left.left)) {
            N newRight = node.edit(currentContext, BLACK, left.right, right);
            return left.edit(currentContext, RED, left.left.blacken(currentContext), newRight);
        }
        else if (isRed(left) && isRed(left.right)) {
            N leftRight = left.right;
            N newLeft = left.edit(currentContext, BLACK, left.left, leftRight.left);
            N newRight = node.edit(currentContext, BLACK, leftRight.right, right);
            return leftRight.edit(currentContext, RED, newLeft, newRight);
        }
        else {
            return node.edit(currentContext, BLACK, left, right);
        }
    }
681939
def theta_join(self, node):
        
        return '[.${op}_{{{conditions}}}$ {left} {right} ]'\
            .format(op=latex_operator[node.operator],
                    conditions=node.conditions,
                    left=self.translate(node.left),
                    right=self.translate(node.right))
30610
def p_expression_b_op(p):
    ''''''
    if p[2] == 'AND':
        p[0] = p[1] & p[3]
    elif p[2] == 'OR':
        p[0] = p[1] | p[3]
1006438
public static ExprBoolean toExprBoolean(Expression left, Expression right, int operation) {
	return new OpDecision(left, right, operation);
    }
1071481
def _calculate_operation_math(self, rule, left, right):
        

        # Attempt to keep integer data type for the result, when possible.
        if isinstance(left, IntegerRule) and isinstance(right, IntegerRule):
            result = self.evaluate_binop_math(rule.operation, left.value, right.value)
            if isinstance(result, list):
                return ListRule([IntegerRule(r) for r in result])
            return IntegerRule(result)

        # Otherwise the result is float.
        if isinstance(left, NumberRule) and isinstance(right, NumberRule):
            result = self.evaluate_binop_math(rule.operation, left.value, right.value)
            if isinstance(result, list):
                return ListRule([FloatRule(r) for r in result])
            return FloatRule(result)

        # This point should never be reached.
        raise Exception()
43066
def do_OP_LEFT(vm):
    
    pos = vm.pop_nonnegative()
    vm.append(vm.pop()[:pos])
762644
def ensure_compatible(left, right):
    """"""
    conflicts = list(conflicting_pairs(left, right))
    if conflicts:
        raise ValueError('conflicting values for object/property pairs: %r' % conflicts)
832340
function addB(product, left, right) {
  for (var i = 0; i < product.deltas.length; i++) {
    left.deltas[i] = product.deltas[i];
    right.deltas[i] = product.deltas[i];
  }
}
34027
def reflect_left(self, value):
        """"""
        if value > self:
            value = self.reflect(value)
        return value
30147
def symm_op(g, ax, theta, do_refl):
    

    # Imports
    import numpy as np

    # Depend on lower functions' geometry vector coercion. Just
    #  do the rotation and, if indicated, the reflection.
    gx = geom_rotate(g, ax, theta)
    if do_refl:
        gx = geom_reflect(gx, ax)
    ## end if

    # Should be good to go
    return gx
421840
def mul(left, right):
    
    from .mv_mul import MvMul
    length = max(left, right)
    if length == 1:
        return Mul(left, right)
    return MvMul(left, right)