Adds histogram with dimensions to the registry
969102
def histogram(self, key, **dims):
        """"""
        return super(RegexRegistry, self).histogram(self._get_key(key), **dims)
259841
def _add_stats_box(h1: Histogram1D, ax: Axes, stats: Union[str, bool] = "all"):
    

    # place a text box in upper left in axes coords
    if stats in ["all", True]:
        text = "Total: {0}\nMean: {1:.2f}\nStd.dev: {2:.2f}".format(
            h1.total, h1.mean(), h1.std())
    elif stats == "total":
        text = "Total: {0}".format(h1.total)
    else:
        raise ValueError("Invalid stats specification")
        
    ax.text(0.05, 0.95, text, transform=ax.transAxes,
            verticalalignment='top', horizontalalignment='left')
642121
def _histogram_digitize(a, w, edges, normed):
    
    weighted = w is not None
    nbin = edges.shape[0] + 1
    if weighted:
        count = zeros(nbin, dtype=w.dtype)
        if normed:
            count = zeros(nbin, dtype=float)
            w = w / w.mean()
    else:
        count = zeros(nbin, int)

    binindex = digitize(a, edges)

    # Count the number of identical indices.
    flatcount = bincount(binindex, w)

    # Place the count in the histogram array.
    count[:len(flatcount)] = flatcount

    return count
111646
def _create_scales(hist: HistogramBase, vega: dict, kwargs: dict):
    """"""
    if hist.ndim == 1:
        bins0 = hist.bins.astype(float)
    else:
        bins0 = hist.bins[0].astype(float)

    xlim = kwargs.pop("xlim", "auto")
    ylim = kwargs.pop("ylim", "auto")

    if xlim is "auto":
        nice_x = True
    else:
        nice_x = False

    if ylim is "auto":
        nice_y = True
    else:
        nice_y = False

    # TODO: Unify xlim & ylim parameters with matplotlib
    # TODO: Apply xscale & yscale parameters

    vega["scales"] = [
        {
            "name": "xscale",
            "type": "linear",
            "range": "width",
            "nice": nice_x,
            "zero": None,
            "domain": [bins0[0, 0], bins0[-1, 1]] if xlim == "auto" else [float(xlim[0]), float(xlim[1])],
            # "domain": {"data": "table", "field": "x"}
        },
        {
            "name": "yscale",
            "type": "linear",
            "range": "height",
            "nice": nice_y,
            "zero": True if hist.ndim == 1 else None,
            "domain": {"data": "table", "field": "y"} if ylim == "auto" else [float(ylim[0]), float(ylim[1])]
        }
    ]

    if hist.ndim >= 2:
        bins1 = hist.bins[1].astype(float)
        vega["scales"][1]["domain"] = [bins1[0, 0], bins1[-1, 1]]
85562
def with_dimensions(self, *dimensions):
    """"""
    self.dimensions = tuple(
        self._maybe_make_dimension(dim) for dim in dimensions)
    self._cached = None
    return self
177476
def calculate_dimensions(image, long_side, short_side):
    """"""
    if image.width >= image.height:
        return '{0}x{1}'.format(long_side, short_side)
    return '{0}x{1}'.format(short_side, long_side)
1177558
def make_random_histogram(length=100, num_bins=10):
    ""

    hist, bin_edges = np.histogram(np.random.random(length),
                                   bins=num_bins, density=True)

    # to ensure they sum to 1.0
    hist = hist / sum(hist)

    if len(hist) < 2:
        raise ValueError('Invalid histogram')

    return hist
1300816
public void addRegistry(Registry... registries){
		for (Registry registry: registries){
			registryList.add(registryList.size()-1, registry);
		}
	}
558709
private void initAnsiWidths() {
        ansiWidth = new int[256];
        for (int i = 0; i < 256; i++) {
            ansiWidth[i] = mtxTab[0].getWx();
        }

        // Create an index hash to the ansiWidth
        // Can't just index the winAnsiEncoding when inserting widths
        // same char (eg bullet) is repeated more than one place
        ansiIndex = new java.util.HashMap();
        for (int i = 32; i < Glyphs.WINANSI_ENCODING.length; i++) {
            Integer ansi = new Integer(i);
            Integer uni = new Integer(Glyphs.WINANSI_ENCODING[i]);

            List v = (List)ansiIndex.get(uni);
            if (v == null) {
                v = new java.util.ArrayList();
                ansiIndex.put(uni, v);
            }
            v.add(ansi);
        }
    }
1060889
def histogram(data, bins=None, binsize=1., min=None, max=None, rev=False, use_weave=True, verbose=0):
    

    if not have_scipy:
        use_weave=False
     
    dowhere=False
    s = data.argsort()
    if min is not None:
        dmin = min
        dowhere=True
    else:
        dmin = data[s[0]]

    if max is not None:
        dmax = max
        dowhere=True
    else:
        dmax = data[s[-1]]

    bsize = float(binsize)
#    except TypeError :
#        print '[Warning] TypeError reached - type {0}'.format(type(binsize[0]))
#        bsize = binsize
#    finally : pass

    if dowhere:
        # where will preserve order, so subscript with s
        w,=numpy.where( (data[s] >= dmin) & (data[s] <= dmax) )
        if w.size == 0:
            raise ValueError("No data in specified min/max range\n")
        s = s[w]

    nbin = numpy.int64( (dmax-dmin)/bsize ) + 1

    if bins is not None :
        s = bins
        nbin = len(s)

    if rev:
        revsize = s.size + nbin+1
        revind = numpy.zeros(revsize, dtype='i8')
    else:
        # this is just a dummy variable
        revind=numpy.zeros(1, dtype='i8')
    hist = numpy.zeros(nbin, dtype='i8')

    # populate the array from nbin+1:nbin+1+s.size
    # with the sort indices.  Simultaneosly record bin
    # edges at the beginning of reverse indices

    if use_weave:
        _weave_dohist(data, s, bsize, hist, revind, dorev=rev,verbose=verbose)
    else:
        _dohist(data, s, bsize, hist, revind, dorev=rev)

    if rev:
        return hist, revind
    else:
        return hist
1259620
function getHistogram(domain, mappedValue) {
  const histogram = histogramConstruct(domain, mappedValue, histogramBins);
  const enlargedHistogram = histogramConstruct(
    domain,
    mappedValue,
    enlargedHistogramBins
  );

  return {histogram, enlargedHistogram};
}
555128
function histogram() {
  const histogram = {
    r: new Array(256).fill(0),
    g: new Array(256).fill(0),
    b: new Array(256).fill(0)
  };

  this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function(
    x,
    y,
    index
  ) {
    histogram.r[this.bitmap.data[index + 0]]++;
    histogram.g[this.bitmap.data[index + 1]]++;
    histogram.b[this.bitmap.data[index + 2]]++;
  });

  return histogram;
}
224700
def values(self):
        ""
        if util.config.future_deprecations:
            self.param.warning('Histogram.values is deprecated in favor of '
                               'common dimension_values method.')
        return self.dimension_values(1)
247298
def add_dimension(cls, columns, dimension, dim_pos, values, vdim):
        
        if not vdim:
            raise Exception("Cannot add key dimension to a dense representation.")
        raise NotImplementedError
616065
def histogram(module, name, value):
    
    histogram = get_metric('histograms', module, name, Histogram())
    histogram.update(value)
535365
def add_namespace_statistics(self, namespace, offset, data_points,
                                 byte_count):
        """"""
        query = 'UPDATE gauged_statistics ' \
            'SET data_points = data_points + %s,' \
            'byte_count = byte_count + %s WHERE namespace = %s ' \
            'AND "offset" = %s; INSERT INTO gauged_statistics ' \
            'SELECT %s, %s, %s, %s WHERE NOT EXISTS (' \
            'SELECT 1 FROM gauged_statistics WHERE namespace = %s' \
            'AND "offset" = %s)'
        self.cursor.execute(query, (data_points, byte_count, namespace,
                                    offset, namespace, offset, data_points,
                                    byte_count, namespace, offset))
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]++;
			}
		}
	}