Raise warning for negative numbers.
344645
def _check_negatives(numbers):
    ""

    negatives = filter(lambda x: x < 0, filter(None, numbers))
    if any(negatives):
        neg_values = ', '.join(map(str, negatives))
        msg = 'Found negative value(s): {0!s}. '.format(neg_values)
        msg += 'While not forbidden, the output will look unexpected.'
        warnings.warn(msg)
172197
def display_warning(self):
        """"""
        if self.warn:
            warnings.warn(
                "\nProperty '{}' is deprecated and may be removed in the "
                "future. Please use '{}'.".format(self.name, self.new_name),
                FutureWarning, stacklevel=3
            )
614179
def _fail(self, message, text, i):
        """"""

        raise ValueError("{}:\n{}".format(message, text[i : i + 79]))
701307
public static void negative( InterleavedS16 input , InterleavedS16 output ) {

		output.reshape(input.width,input.height);

		int columns = input.width*input.numBands;
		if(BoofConcurrency.USE_CONCURRENT ) {
			ImplPixelMath_MT.negative(input.data, input.startIndex, input.stride,
					output.data, output.startIndex, output.stride,
					input.height, columns);
		} else {
			ImplPixelMath.negative(input.data, input.startIndex, input.stride,
					output.data, output.startIndex, output.stride,
					input.height, columns);
		}
	}
517005
def to_positive_multiple_of_10(string):
    """"""
    try:
        value = int(string)
    except ValueError:
        msg = '"%r" is not a positive multiple of 10 (greater zero).' % string
        raise argparse.ArgumentTypeError(msg)
    if value <= 0 or value % 10 != 0:
        msg = '"%r" is not a positive multiple of 10 (greater zero).' % string
        raise argparse.ArgumentTypeError(msg)
    return value
285693
public static void notNegative(Integer value) {
		if(!validation) return;
		Validate.notNull(value);
		if(value < 0)
			throw new ParameterException(ErrorCode.NEGATIVE);
	}
1138449
def speckleRange(self, value):
        """"""
        if value >= 0:
            self._speckle_range = value
        else:
            raise InvalidSpeckleRangeError("Speckle range cannot be negative.")
        self._replace_bm()
1258217
def AddWarning(self, warning):
    
    self._RaiseIfNotWritable()

    warning = self._PrepareAttributeContainer(warning)

    self._warnings.append(warning)
    self.number_of_warnings += 1
1274002
private int getNonNegativeInt(String s) {
        int i;

        try {
            i = Integer.parseInt(s);
        } catch (NumberFormatException e) {
            throw new IllegalArgumentException("Unable to handle non-numeric value " + s);
        }

        if (i < 0) {
            throw new IllegalArgumentException(s + " is an invalid index value");
        }

        return i;
    }
478298
public static void notNegative(Double value) {
		if(!validation) return;
		notNull(value);
		if(value < 0)
			throw new ParameterException(ErrorCode.NEGATIVE);
	}
863533
def warn(self, key):
        """"""
        return (not self.quiet and not self.warn_none and
                (self.warn_all or getattr(self, "warn_%s" % key)))
1320718
function(num) {
            if(typeof num !== "number") {
                return NaN;
            }
            var isNegative = (num < 0),
                result;

            if(isNegative) {
                num = -num;
            }
            if(num < 10) {
                num += (10 - num) / 10;
            }
            result = this.logBaseTen(num);
            return (isNegative) ? -result : result;
        }
609095
def warn(self, msg, *args, **kwargs):
    """"""
    if six.PY3:
      warnings.warn("The 'warn' method is deprecated, use 'warning' instead",
                    DeprecationWarning, 2)
    self.log(logging.WARN, msg, *args, **kwargs)
640041
function(num) {
            if(typeof num !== "number") {
                return NaN;
            }
            var isNegative = num < 0;
            num = (isNegative) ? -num : num;
            var log = this.logBaseTen(num),
                result = Math.pow(10, Math.floor(log));

            return (isNegative) ? -result: result;
        }
21286
def neg(self, value, name=''):
        
        return self.sub(values.Constant(value.type, 0), value, name=name)
813052
def warning(*args):
    """"""
    if sys.stdin.isatty():
        print('WARNING:', *args, file=sys.stderr)
    else:
        notify_warning(*args)
966182
def check_nonnegative(value):
  """"""
  if isinstance(value, tf.Tensor):
    with tf.control_dependencies([tf.assert_greater_equal(value, 0)]):
      value = tf.identity(value)
  elif value < 0:
    raise ValueError("Value must be non-negative.")
  return value