Generate histogram using number from numberfile, and only numbers in the
    range of (vmin, vmax)
961407
def histogram(numberfile, vmin, vmax, xlabel, title, outfmt="pdf",
              bins=50, skip=0, col=0, ascii=False, base=0, fill="white"):
    
    if ascii:
        return texthistogram([numberfile], vmin, vmax, title=title,
                bins=bins, skip=skip, col=col, base=base)

    data, vmin, vmax = get_data(numberfile, vmin, vmax, skip=skip, col=col)
    outfile = numberfile + ".base{0}.{1}".format(base, outfmt) \
                if base else numberfile + ".pdf"
    template = histogram_log_template if base else histogram_template
    rtemplate = RTemplate(template, locals())
    rtemplate.run()
596283
public static void histogram( GrayS8 input , int minValue , int histogram[] ) {
		if( BoofConcurrency.USE_CONCURRENT ) {
			ImplImageStatistics_MT.histogram(input,minValue,histogram);
		} else {
			ImplImageStatistics.histogram(input,minValue,histogram);
		}
	}
576152
def numeric(basetype, min_=None, max_=None):
    """"""
    min_ = basetype(min_) if min_ is not None else None
    max_ = basetype(max_) if max_ is not None else None

    def _numeric(string):
        value = basetype(string)
        if min_ is not None and value < min_ or max_ is not None and value > max_:
            msg = "%r not in valid range %r" % (string, (min_, max_))
            raise argparse.ArgumentTypeError(msg)
        return value

    _numeric.__name__ = basetype.__name__
    return _numeric
1359099
function getNumber (type, min, max, format, options) {
  var ret;

  // Juggle the arguments if the user didn't supply a format string
  if (!options) {
    options = format;
    format = null;
  }

  if (type === 'int') {
    ret = utils.randomInt(min, max);
  } else if (type === 'float') {
    ret = utils.randomFloat(min, max);
  }

  if (typeof options.hash.round === 'number') {
    ret = Math.round(ret / options.hash.round) * options.hash.round;
  }

  if (format) {
    ret = numbro(ret).format(format);
  }

  return ret;
}
1296040
def _load_int(self):
        """"""
        values = numpy.fromfile(self.filepath_int)
        if self.NDIM > 0:
            values = values.reshape(self.seriesshape)
        return values
411879
def create_hist(self, evclass, evtype, xsep, energy, ctheta,
                    fill_sep=False, fill_evtype=False):
        """"""

        nevt = len(evclass)
        ebin = utils.val_to_bin(self._energy_bins, energy)
        scale = self._psf_scale[ebin]

        vals = [energy, ctheta]
        bins = [self._energy_bins, self._ctheta_bins]

        if fill_sep:
            vals += [xsep]
            bins += [self._xsep_bins]

        if fill_evtype:
            loopv = [self._evclass_bins[:-1], self._evtype_bins[:-1]]
            shape = [16, 16] + [len(b) - 1 for b in bins]
        else:
            loopv = [self._evclass_bins[:-1]]
            shape = [16] + [len(b) - 1 for b in bins]

        h = np.zeros(shape)
        for t in itertools.product(*loopv):

            m = (evclass[:, int(t[0])] == True)
            if fill_evtype:
                m &= (evtype[:, int(t[1])] == True)
            if not np.sum(m):
                continue

            z = np.vstack(vals)
            z = z[:, m]

            if fill_evtype:
                h[int(t[0]), int(t[1])] += np.histogramdd(z.T, bins=bins)[0]
            else:
                h[int(t[0])] += np.histogramdd(z.T, bins=bins)[0]

        return h
742096
function (num, min, max) {
        if (typeof num !== 'number' || num < min) {
            return min;
        }
        if (num === Infinity) {
            return _.isNil(max) ? min : max;
        }

        return num;
    }
964895
def _file_iter_range(fp, offset, bytes, maxread=1024*1024):
    ''' '''
    fp.seek(offset)
    while bytes > 0:
        part = fp.read(min(bytes, maxread))
        if not part: break
        bytes -= len(part)
        yield part
562692
public static void histogram( GrayF32 input , float minValue , int histogram[] ) {
		if( BoofConcurrency.USE_CONCURRENT ) {
			ImplImageStatistics_MT.histogram(input,minValue,histogram);
		} else {
			ImplImageStatistics.histogram(input,minValue,histogram);
		}
	}
1254696
def _histplot_bins(column, bins=100):
    """"""
    col_min = np.min(column)
    col_max = np.max(column)
    return range(col_min, col_max + 2, max((col_max - col_min) // bins, 1))
802955
def check_range(number, min_r, max_r, name=""):
    
    try:
        number = float(number)
        if number < min_r or number > max_r:
            raise FFmpegNormalizeError(
                "{} must be within [{},{}]".format(
                    name, min_r, max_r
                )
            )
        return number
        pass
    except Exception as e:
        raise e
830884
def relfreq(inlist, numbins=10, defaultreallimits=None):
    
    h, l, b, e = histogram(inlist, numbins, defaultreallimits)
    for i in range(len(h)):
        h[i] = h[i] / float(len(inlist))
    return h, l, b, e
844439
def make_data(n,m):
    """"""
    I = range(1,n+1)
    J = range(1,m+1)
    x,y,w = {},{},{}
    for i in I:
        x[i] = random.randint(0,100)
        y[i] = random.randint(0,100)
        w[i] = random.randint(1,5)
    return I,J,x,y,w
67133
def _encode_numbers(self, obj):
        """"""

        # strict checks first - for speed
        if obj.__class__ is int:
            if abs(obj) > JAVASCRIPT_MAXINT:
                raise ValueError('Number out of range: {!r}'.format(obj))
            return str(obj)

        if obj.__class__ is float:
            if isnan(obj):
                raise ValueError('NaN is not supported')
            if isinf(obj):
                raise ValueError('Infinity is not supported')
            return repr(obj)

        # more in-depth class analysis last
        if isinstance(obj, int):
            obj = int(obj)
            if abs(obj) > JAVASCRIPT_MAXINT:
                raise ValueError('Number out of range: {!r}'.format(obj))
            return str(obj)

        if isinstance(obj, float):
            if isnan(obj):
                raise ValueError('NaN is not supported')
            if isinf(obj):
                raise ValueError('Infinity is not supported')
            return repr(obj)

        if isinstance(obj, Decimal):
            return '"' + str(obj) + '"'

        # for complex and other Numbers
        return self._encode(self.default(obj))
441280
def _digits(minval, maxval):
    """"""
    if minval == maxval:
        return 3
    else:
        return min(10, max(2, int(1 + abs(np.log10(maxval - minval)))))
1152214
public static void localHistogram( GrayU16 input , int x0 , int y0 , int x1, int y1 , int histogram[] ) {
		for( int i = 0; i < histogram.length; i++ )
			histogram[i] = 0;

		for( int i = y0; i < y1; i++ ) {
			int index = input.startIndex + i*input.stride + x0;
			int end = index + x1-x0;
			for( ; index < end; index++ ) {
				histogram[input.data[index] & 0xFFFF]++;
			}
		}
	}
171202
def r_num(obj):
    """"""
    if isinstance(obj, (list, tuple)):
        it = iter
    else:
        it = LinesIterator
    dataset = Dataset([Dataset.FLOAT])
    return dataset.load(it(obj))