Return an xor term' expression, eliminates left recursion.
963209
def _xorterm_prime(lexer):
    """"""
    tok = next(lexer)
    # '^' PRODTERM XORTERM'
    if isinstance(tok, OP_xor):
        prodterm = _prodterm(lexer)
        xorterm_prime = _xorterm_prime(lexer)
        if xorterm_prime is None:
            return prodterm
        else:
            return ('xor', prodterm, xorterm_prime)
    # null
    else:
        lexer.unpop_token(tok)
        return None
65952
private ExprKraken parseMulExpr()
  {
    ExprKraken left = parseSimpleTerm();

    while (true) {
      Token token = scanToken();

      switch (token) {
      case STAR:
        left = new BinaryExpr(BinaryOp.MUL, left, parseSimpleTerm());
        break;
      case DIV:
        left = new BinaryExpr(BinaryOp.DIV, left, parseSimpleTerm());
        break;
      case MOD:
        left = new BinaryExpr(BinaryOp.MOD, left, parseSimpleTerm());
        break;

      default:
        _token = token;
        return left;
      }
    }
  }
494599
def uxor(self):
        """"""
        return reduce(operator.xor, self._items, self.ftype.box(0))
658835
public static Boolean xor(Boolean left, Boolean right) {
        return left ^ Boolean.TRUE.equals(right);
    }
283723
def expr(self):
        
        node = self.term()

        while self.token.nature in (Nature.PLUS, Nature.MINUS):
            token = self.token
            if token.nature == Nature.PLUS:
                self._process(Nature.PLUS)
            elif token.nature == Nature.MINUS:
                self._process(Nature.MINUS)
            else:
                self._error()

            node = BinaryOperation(left=node, op=token, right=self.term())

        return node
1257946
def OneHot(*xs, simplify=True, conj=True):
    
    xs = [Expression.box(x).node for x in xs]
    terms = list()
    if conj:
        for x0, x1 in itertools.combinations(xs, 2):
            terms.append(exprnode.or_(exprnode.not_(x0),
                                      exprnode.not_(x1)))
        terms.append(exprnode.or_(*xs))
        y = exprnode.and_(*terms)
    else:
        for i, xi in enumerate(xs):
            zeros = [exprnode.not_(x) for x in xs[:i] + xs[i+1:]]
            terms.append(exprnode.and_(xi, *zeros))
        y = exprnode.or_(*terms)
    if simplify:
        y = y.simplify()
    return _expr(y)
963802
def find_lt(a, x):
    """"""
    i = bs.bisect_left(a, x)
    if i: return i - 1
    raise ValueError
1195988
def OneHot0(*xs, simplify=True, conj=True):
    
    xs = [Expression.box(x).node for x in xs]
    terms = list()
    if conj:
        for x0, x1 in itertools.combinations(xs, 2):
            terms.append(exprnode.or_(exprnode.not_(x0),
                                      exprnode.not_(x1)))
        y = exprnode.and_(*terms)
    else:
        for _xs in itertools.combinations(xs, len(xs) - 1):
            terms.append(exprnode.and_(*[exprnode.not_(x) for x in _xs]))
        y = exprnode.or_(*terms)
    if simplify:
        y = y.simplify()
    return _expr(y)
164618
def simplify(self):
        """"""
        d = defaultdict(float)
        for term in self.terms:
            term = term.simplify()
            d[term.ops] += term.coeff
        return Expr.from_terms_iter(
            Term.from_ops_iter(k, d[k]) for k in sorted(d, key=repr) if d[k])
291997
def _call(self, x, out=None):
        """"""
        if out is None:
            return self.left(x) * self.right(x)
        else:
            tmp = self.right.range.element()
            # Write to `tmp` first, otherwise aliased `x` and `out` lead
            # to wrong result
            self.left(x, out=tmp)
            self.right(x, out=out)
            out *= tmp
1309700
def XOR(classical_reg1, classical_reg2):
    
    left, right = unpack_reg_val_pair(classical_reg1, classical_reg2)
    return ClassicalExclusiveOr(left, right)
1045944
def consolidate_reverse_exprs(initial_state):
    
    initial_state.inspect.b('mem_read', when=angr.BP_AFTER, action=_read_consolidate)
    initial_state.inspect.b('reg_read', when=angr.BP_AFTER, action=_read_consolidate)
245071
def Subscript(index_node):
    """"""
    return Node(syms.trailer, [Leaf(token.LBRACE, u"["),
                               index_node,
                               Leaf(token.RBRACE, u"]")])
922335
def logical_xor(f1, f2):  # function factory
    '''
    '''
    def f_xor(arr):
        return np.logical_xor(f1(arr), f2(arr))
    f_xor.__name__ = f1.__name__ + "_xor_" + f2.__name__
    return f_xor
896134
def ast2expr(ast):
    """"""
    if ast[0] == 'const':
        return _CONSTS[ast[1]]
    elif ast[0] == 'var':
        return exprvar(ast[1], ast[2])
    else:
        xs = [ast2expr(x) for x in ast[1:]]
        return ASTOPS[ast[0]](*xs, simplify=False)
699627
private static Node asDetachedExpression(Node expr) {
    switch (expr.getToken()) {
      case SPREAD:
        expr = IR.arraylit(expr.detach()).srcref(expr);
        break;
      default:
        break;
    }

    if (expr.getParent() != null) {
      expr.detach();
    }

    checkState(IR.mayBeExpression(expr), expr);
    return expr;
  }
13070
def p_expr_unary_op(p):
    ''''''
    p[0] = ast.UnaryOp(p[1], p[2], lineno=p.lineno(1))