~~ *unary_operations, **unary_operations_options
193163
def through_maxima(*array_options, **options)
      @after_maxima ||= Command.output(itself: Unit) do |c|
        c.let :itself, self.to_s, *array_options, **options
      end[:itself]
    end
1217329
function (f, direction) {

        if (typeof (f) !== 'function') {
            var prop = f;
            // make unary function
            f = function (v1) {

                return v1[prop];
            };
        }
        if (f.length === 1) {
            // f is a unary function mapping a single item to its sort score
            var uf = f;
            f = function (v1, v2) {

                return uf(v1) < uf(v2) ? -1 : uf(v1) > uf(v2) ? 1 : 0;
            };
        }
        if (direction === -1) {
            return function (v1, v2) {

                return -f(v1, v2);
            };
        }
        return f;
    }
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
1086341
def ULT(self, o):
        

        unsigned_bounds_1 = self._unsigned_bounds()
        unsigned_bounds_2 = o._unsigned_bounds()

        ret = []
        for lb_1, ub_1 in unsigned_bounds_1:
            for lb_2, ub_2 in unsigned_bounds_2:
                if ub_1 < lb_2:
                    ret.append(TrueResult())
                elif lb_1 >= ub_2:
                    ret.append(FalseResult())
                else:
                    ret.append(MaybeResult())

        if all(r.identical(TrueResult()) for r in ret):
            return TrueResult()
        elif all(r.identical(FalseResult()) for r in ret):
            return FalseResult()
        else:
            return MaybeResult()
447566
function processUnary(tokenizer, scope) {
  const unaryAddSubtract = {
    '-': value => -value,
    '+': value => value
  };

  if (tokenizer.token.match(types.ADD_SUBTRACT)) {
    return createOperatorNode(unaryAddSubtract[tokenizer.token.lexeme], [processUnary(tokenizer.skipToken(), scope)]);
  }

  if (tokenizer.token.match(types.INCREASE_DECREASE) || tokenizer.token.match(types.LOGICAL_NEGATION)) {
    return createOperatorNode(tokenizer.token.value, [processUnary(tokenizer.skipToken(), scope)]);
  }

  return processIdentifiers(tokenizer, scope);
}
1258290
def infer_unaryop(self, context=None):
    """"""
    yield from _filter_operation_errors(
        self, _infer_unaryop, context, util.BadUnaryOperationMessage
    )
    return dict(node=self, context=context)
245614
def __op(name, val, fmt=None, const=False, consume=0, produce=0):
    

    name = name.lower()

    # fmt can either be a str representing the struct to unpack, or a
    # callable to do more complex unpacking. If it's a str, create a
    # callable for it.
    if isinstance(fmt, str):
        fmt = partial(_unpack, compile_struct(fmt))

    operand = (name, val, fmt, consume, produce, const)

    assert(name not in __OPTABLE)
    assert(val not in __OPTABLE)

    __OPTABLE[name] = operand
    __OPTABLE[val] = operand

    return val
67092
def _wrap_unary_errors(callable_):
    """"""
    _patch_callable_name(callable_)

    @six.wraps(callable_)
    def error_remapped_callable(*args, **kwargs):
        try:
            return callable_(*args, **kwargs)
        except grpc.RpcError as exc:
            six.raise_from(exceptions.from_grpc_error(exc), exc)

    return error_remapped_callable
75919
def visit_UnaryOp(self, node: AST, dfltChaining: bool = True) -> str:
        """"""
        op = node.op
        with self.op_man(op):
            return self.visit(op) + self.visit(node.operand)
542795
function uninfinite(u, src) {
  for (var i = 0; i < src.length; i++) {
    if (src[i] === Infinity) u[i] = 255
  }
  return u
}
356455
@Override
	@SuppressWarnings("unchecked")
	public UnaryOperatorInformation<IN, OUT> getOperatorInfo() {
		return (UnaryOperatorInformation<IN, OUT>) this.operatorInfo;
	}
917961
def is_unary_operator(oper):
    """"""
    # definition:
    # member in class
    # ret-type operator symbol()
    # ret-type operator [++ --](int)
    # globally
    # ret-type operator symbol( arg )
    # ret-type operator [++ --](X&, int)
    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) == 0:
            return True
        elif oper.symbol in ['++', '--'] and \
                isinstance(oper.arguments[0].decl_type, cpptypes.int_t):
            return True
        return False

    if len(oper.arguments) == 1:
        return True
    elif oper.symbol in ['++', '--'] \
            and len(oper.arguments) == 2 \
            and isinstance(oper.arguments[1].decl_type, cpptypes.int_t):
        # may be I need to add additional check whether first argument is
        # reference or not?
        return True
    return False
453876
private void initUnaryOperators() {
        initOperators(unaryOperators,
                new UnaryNumericOperator(Tag.POS)
                        .addUnaryOperator(DOUBLE, DOUBLE, nop)
                        .addUnaryOperator(FLOAT, FLOAT, nop)
                        .addUnaryOperator(LONG, LONG, nop)
                        .addUnaryOperator(INT, INT, nop),
                new UnaryNumericOperator(Tag.NEG)
                        .addUnaryOperator(DOUBLE, DOUBLE, dneg)
                        .addUnaryOperator(FLOAT, FLOAT, fneg)
                        .addUnaryOperator(LONG, LONG, lneg)
                        .addUnaryOperator(INT, INT, ineg),
                new UnaryNumericOperator(Tag.COMPL, Type::isIntegral)
                        .addUnaryOperator(LONG, LONG, lxor)
                        .addUnaryOperator(INT, INT, ixor),
                new UnaryPrefixPostfixOperator(Tag.POSTINC)
                        .addUnaryOperator(DOUBLE, DOUBLE, dadd)
                        .addUnaryOperator(FLOAT, FLOAT, fadd)
                        .addUnaryOperator(LONG, LONG, ladd)
                        .addUnaryOperator(INT, INT, iadd)
                        .addUnaryOperator(CHAR, CHAR, iadd)
                        .addUnaryOperator(SHORT, SHORT, iadd)
                        .addUnaryOperator(BYTE, BYTE, iadd),
                new UnaryPrefixPostfixOperator(Tag.POSTDEC)
                        .addUnaryOperator(DOUBLE, DOUBLE, dsub)
                        .addUnaryOperator(FLOAT, FLOAT, fsub)
                        .addUnaryOperator(LONG, LONG, lsub)
                        .addUnaryOperator(INT, INT, isub)
                        .addUnaryOperator(CHAR, CHAR, isub)
                        .addUnaryOperator(SHORT, SHORT, isub)
                        .addUnaryOperator(BYTE, BYTE, isub),
                new UnaryBooleanOperator(Tag.NOT)
                        .addUnaryOperator(BOOLEAN, BOOLEAN, bool_not),
                new UnaryReferenceOperator(Tag.NULLCHK)
                        .addUnaryOperator(OBJECT, OBJECT, nullchk));
    }
592398
def _add_numeric_methods_unary(cls):
        
        def _make_evaluate_unary(op, opstr):

            def _evaluate_numeric_unary(self):

                self._validate_for_numeric_unaryop(op, opstr)
                attrs = self._get_attributes_dict()
                attrs = self._maybe_update_attributes(attrs)
                return Index(op(self.values), **attrs)

            _evaluate_numeric_unary.__name__ = opstr
            return _evaluate_numeric_unary

        cls.__neg__ = _make_evaluate_unary(operator.neg, '__neg__')
        cls.__pos__ = _make_evaluate_unary(operator.pos, '__pos__')
        cls.__abs__ = _make_evaluate_unary(np.abs, '__abs__')
        cls.__inv__ = _make_evaluate_unary(lambda x: -x, '__inv__')
721077
function bitop(operation, destkey /* key1, keyN, req */) {
  var keys = slice.call(arguments, 2)
    , req = typeof keys[keys.length - 1] === 'object' ? keys.pop() : null
    , buffers = []
    , plen
    , ind
    , len = 0
    , out
    , buf
    , byte
    , i
    , j
    , v;

  // unary operation, ensure keys length is one
  if(operation === BITOP.NOT) {
    keys = keys.slice(0, 1);
  }

  for(i = 0;i < keys.length;i++) {
    v = this.getKey(keys[i], req);
    if(v === undefined) {
      buffers.push(EMPTY);
    }else if(typeof v === 'number') {
      buffers.push(new Buffer([v]));
    }else if(typeof v === 'string') {
      buffers.push(new Buffer(v));
    /* istanbul ignore else: not testing unsupported types */
    }else if(Buffer.isBuffer(v)) {
      buffers.push(v);
    }

    // last buffer added, used to get longest buffer length
    buf = buffers[buffers.length - 1];

    // previous length so we can get index of longest buffer
    plen = len;

    // calculate longest buffer length
    len = Math.max(len, buf.length);

    // find index of longest buffer
    if(len > plen) {
      ind = buffers.length - 1;
    }
  }

  // use the longest one as the start buffer
  // and copy so as not to modify the original
  // key data if it was already a buffer
  buf = buffers.splice(ind, 1)[0];
  out = new Buffer(buf);

  // give us something for the outer loop to
  // iterate over
  if(operation === BITOP.NOT) {
    buffers.push(out);
  }

  for(i = 0;i < buffers.length;i++) {
    buf = buffers[i];
    for(j = 0;j < out.length;j++) {
      if(operation === BITOP.NOT) {
        out[j] = ~out[j];
        continue;
      }
      byte = j < buf.length ? buf[j] : 0;
      switch(operation) {
        case BITOP.AND:
          out[j] &= byte;
          break;
        case BITOP.OR:
          out[j] |= byte;
          break;
        case BITOP.XOR:
          out[j] ^= byte;
          break;
      }
    }
  }

  if(len) this.setKey(destkey, out, undefined, undefined, undefined, req);
  return len;
}
155903
function processOperators (ops) {
    if (!ops) return {};
    var operators = {};
    for (var i=0,k,prec;prec=ops[i]; i++) {
        for (k=1;k < prec.length;k++) {
            operators[prec[k]] = {precedence: i+1, assoc: prec[0]};
        }
    }
    return operators;
}
792744
def evaluate_unop(self, operation, right, **kwargs):
        
        if not operation in self.unops:
            raise ValueError("Invalid unary operation '{}'".format(operation))
        if right is None:
            return None
        return self.unops[operation](right)