Helper function to compute tick mappings based on `ticks` and
        default orders and bins.
768979
def _compute_tick_mapping(self, kind, order, bins):
        

        if kind == "angle":
            ticks = self.xticks
            reverse = True
        elif kind == "radius":
            ticks = self.yticks
            reverse = False

        if callable(ticks):
            text_nth = [x for x in order if ticks(x)]

        elif isinstance(ticks, (tuple, list)):
            bins = self._get_bins(kind, ticks, reverse)
            text_nth = ticks

        elif ticks:
            nth_label = np.ceil(len(order) / float(ticks)).astype(int)
            text_nth = order[::nth_label]

        return {x: bins[x] for x in text_nth}
1277312
function getXPosAdjustedForKink(pos) {   
    var first = clinicalTimelineUtil.getLowerBoundIndex(ticksToShow, pos);
    var second = first + 1;

    if (second > ticksToShow.length - 1) {
      return tickCoordinatesKink[first];
    }
    return tickCoordinatesKink[first] + (pos - ticksToShow[first]) * (tickCoordinatesKink[second] - tickCoordinatesKink[first]) / (ticksToShow[second] - ticksToShow[first]);
  }
163941
function adjustTickAmount() {

			if (maxTicks && !isDatetimeAxis && !categories && !isLinked) { // only apply to linear scale
				var oldTickAmount = tickAmount,
					calculatedTickAmount = tickPositions.length;

				// set the axis-level tickAmount to use below
				tickAmount = maxTicks[xOrY];

				if (calculatedTickAmount < tickAmount) {
					while (tickPositions.length < tickAmount) {
						tickPositions.push(correctFloat(
							tickPositions[tickPositions.length - 1] + tickInterval
						));
					}
					transA *= (calculatedTickAmount - 1) / (tickAmount - 1);
					max = tickPositions[tickPositions.length - 1];

				}
				if (defined(oldTickAmount) && tickAmount !== oldTickAmount) {
					axis.isDirty = true;
				}
			}

		}
708261
def _compute_ticks(self, element, edges, widths, lims):
        
        if self.xticks is None or not isinstance(self.xticks, int):
            return None
        if self.cyclic:
            x0, x1, _, _ = lims
            xvals = np.linspace(x0, x1, self.xticks)
            labels = ["%.0f" % np.rad2deg(x) + '\N{DEGREE SIGN}' for x in xvals]
        elif self.xticks:
            dim = element.get_dimension(0)
            inds = np.linspace(0, len(edges), self.xticks, dtype=np.int)
            edges = list(edges) + [edges[-1] + widths[-1]]
            xvals = [edges[i] for i in inds]
            labels = [dim.pprint_value(v) for v in xvals]
        return [xvals, labels]
1041246
def _get_markers(marks, order, bins):
        

        if callable(marks):
            markers = [x for x in order if marks(x)]
        elif isinstance(marks, list):
            markers = [order[x] for x in marks]
        elif isinstance(marks, tuple):
            markers = marks
        else:
            nth_mark = np.ceil(len(order) / marks).astype(int)
            markers = order[::nth_mark]

        return np.array([bins[x][1] for x in markers])
934471
def bin_spikes(spike_times, binsz):
    
    bins = np.empty((len(spike_times),), dtype=int)
    for i, stime in enumerate(spike_times):
        # around to fix rounding errors
        bins[i] = np.floor(np.around(stime/binsz, 5))
    return bins
994224
def _process_axsettings(self, hist, lims, ticks):
        
        axis_settings = dict(zip(self.axis_settings, [None, None, (None if self.overlaid else ticks)]))
        return axis_settings
108704
function computeLabelSizes(ctx, tickFonts, ticks, caches) {
	var length = ticks.length;
	var widths = [];
	var heights = [];
	var offsets = [];
	var i, j, jlen, label, tickFont, fontString, cache, lineHeight, width, height, nestedLabel, widest, highest;

	for (i = 0; i < length; ++i) {
		label = ticks[i].label;
		tickFont = ticks[i].major ? tickFonts.major : tickFonts.minor;
		ctx.font = fontString = tickFont.string;
		cache = caches[fontString] = caches[fontString] || {data: {}, gc: []};
		lineHeight = tickFont.lineHeight;
		width = height = 0;
		// Undefined labels and arrays should not be measured
		if (!helpers.isNullOrUndef(label) && !helpers.isArray(label)) {
			width = helpers.measureText(ctx, cache.data, cache.gc, width, label);
			height = lineHeight;
		} else if (helpers.isArray(label)) {
			// if it is an array let's measure each element
			for (j = 0, jlen = label.length; j < jlen; ++j) {
				nestedLabel = label[j];
				// Undefined labels and arrays should not be measured
				if (!helpers.isNullOrUndef(nestedLabel) && !helpers.isArray(nestedLabel)) {
					width = helpers.measureText(ctx, cache.data, cache.gc, width, nestedLabel);
					height += lineHeight;
				}
			}
		}
		widths.push(width);
		heights.push(height);
		offsets.push(lineHeight / 2);
	}
	garbageCollect(caches, length);

	widest = widths.indexOf(Math.max.apply(null, widths));
	highest = heights.indexOf(Math.max.apply(null, heights));

	function valueAt(idx) {
		return {
			width: widths[idx] || 0,
			height: heights[idx] || 0,
			offset: offsets[idx] || 0
		};
	}

	return {
		first: valueAt(0),
		last: valueAt(length - 1),
		widest: valueAt(widest),
		highest: valueAt(highest)
	};
}
550827
def tick(self):
        """"""
        now = datetime.datetime.now()
        self.add(now)

        # Create a list of timestamps, one for each period and
        # representing the beginning of that period (i.e. since now.)
        tstamps = [now - datetime.timedelta(seconds=xx)
                   for xx in self._periods]

        # Trim off any tick values older than the earliest timestamp.
        self.removeLT(min(tstamps))

        # Create a list of counts, one for each period and
        # representing the number of ticks in that period.
        counts = [self.getCountGT(xx) for xx in tstamps]

        # Compute a list of rates for the periods.
        rates = [float(xx)/yy for xx, yy in zip(counts, self._periods)]

        # Return the rates as a tuple.
        return tuple(rates)
941442
def tickEFP(self, tickerId, tickType, basisPoints, formattedBasisPoints, totalDividends, holdDays, futureExpiry, dividendImpact, dividendsToExpiry):
        """"""
        return _swigibpy.EWrapper_tickEFP(self, tickerId, tickType, basisPoints, formattedBasisPoints, totalDividends, holdDays, futureExpiry, dividendImpact, dividendsToExpiry)
1058134
def set_yticks(start, step, axes="gca"):
    
    if axes=="gca": axes = _pylab.gca()

    # first get one of the tick label locations
    xposition = axes.yaxis.get_ticklabels()[0].get_position()[0]

    # get the bounds
    ymin, ymax = axes.get_ylim()

    # get the starting tick
    nstart = int(_pylab.floor((ymin-start)/step))
    nstop  = int(_pylab.ceil((ymax-start)/step))
    ticks = []
    for n in range(nstart,nstop+1): ticks.append(start+n*step)

    axes.set_yticks(ticks)

    # set the x-position
    for t in axes.yaxis.get_ticklabels():
        x, y = t.get_position()
        t.set_position((xposition, y))

    _pylab.draw()
1117249
private Tick getIndeciesData(byte[] bin, int x){
        int dec = 100;
        Tick tick = new Tick();
        tick.setMode(modeFull);
        tick.setTradable(false);
        tick.setInstrumentToken(x);
        tick.setLastTradedPrice(convertToDouble(getBytes(bin, 4, 8)) / dec);
        tick.setHighPrice(convertToDouble(getBytes(bin, 8, 12)) / dec);
        tick.setLowPrice(convertToDouble(getBytes(bin, 12, 16)) / dec);
        tick.setOpenPrice(convertToDouble(getBytes(bin, 16, 20)) / dec);
        tick.setClosePrice(convertToDouble(getBytes(bin, 20, 24)) / dec);
        tick.setNetPriceChangeFromClosingPrice(convertToDouble(getBytes(bin, 24, 28)) / dec);
        if(bin.length > 28) {
            long tickTimeStamp = convertToLong(getBytes(bin, 28, 32)) * 1000;
            if(isValidDate(tickTimeStamp)) {
                tick.setTickTimestamp(new Date(tickTimeStamp));
            } else {
                tick.setTickTimestamp(null);
            }
        }
        return tick;
    }
565077
def _histplot_op(ax, data, **kwargs):
    """"""
    bins = get_bins(data)
    ax.hist(data, bins=bins, align="left", density=True, **kwargs)
    return ax
561808
def _add_ticks(xticks=True,yticks=True):
    
    ax=pyplot.gca()
    if xticks:
        xstep= ax.xaxis.get_majorticklocs()
        xstep= xstep[1]-xstep[0]
        ax.xaxis.set_minor_locator(ticker.MultipleLocator(xstep/5.))
    if yticks:
        ystep= ax.yaxis.get_majorticklocs()
        ystep= ystep[1]-ystep[0]
        ax.yaxis.set_minor_locator(ticker.MultipleLocator(ystep/5.))
746141
def _tile_ticks(self, frac, tickvec):
        """"""
        origins = np.tile(self.axis._vec, (len(frac), 1))
        origins = self.axis.pos[0].T + (origins.T*frac).T
        endpoints = tickvec + origins
        return origins, endpoints
743416
function tick(){

    performanceCollector.tick();

    const useMedia = dataManager.getMediaState();
    const playTimeSinceStart = timeManager.getPlayTimeSinceStart();

    for (let key in dataConfig){

        const infoDict = dataConfig[key];

        if (infoDict.status && 
            playTimeSinceStart - infoDict.lastFetchTime > infoDict.timePeriod){
            
            const timeDifferene = playTimeSinceStart - infoDict.lastFetchTime;

            if (useMedia)
                _setEvents(infoDict.calculator.getMediaEvents(timeDifferene));
            
            // always collecting default events
            _setEvents(infoDict.calculator.getEvents(timeDifferene));
                
            infoDict.lastFetchTime = playTimeSinceStart;

        }

    }

}
22616
function () {
		var tick = this,
			axis = tick.axis,
			options = axis.options,
			chart = axis.chart,
			horiz = axis.horiz,
			categories = axis.categories,
			names = axis.series[0] && axis.series[0].names,
			pos = tick.pos,
			labelOptions = options.labels,
			str,
			tickPositions = axis.tickPositions,
			width = (horiz && categories &&
				!labelOptions.step && !labelOptions.staggerLines &&
				!labelOptions.rotation &&
				chart.plotWidth / tickPositions.length) ||
				(!horiz && (chart.margin[3] || chart.chartWidth * 0.33)), // #1580, #1931
			isFirst = pos === tickPositions[0],
			isLast = pos === tickPositions[tickPositions.length - 1],
			css,
			attr,
			value = categories ?
				pick(categories[pos], names && names[pos], pos) : 
				pos,
			label = tick.label,
			tickPositionInfo = tickPositions.info,
			dateTimeLabelFormat;

		// Set the datetime label format. If a higher rank is set for this position, use that. If not,
		// use the general format.
		if (axis.isDatetimeAxis && tickPositionInfo) {
			dateTimeLabelFormat = options.dateTimeLabelFormats[tickPositionInfo.higherRanks[pos] || tickPositionInfo.unitName];
		}

		// set properties for access in render method
		tick.isFirst = isFirst;
		tick.isLast = isLast;

		// get the string
		str = axis.labelFormatter.call({
			axis: axis,
			chart: chart,
			isFirst: isFirst,
			isLast: isLast,
			dateTimeLabelFormat: dateTimeLabelFormat,
			value: axis.isLog ? correctFloat(lin2log(value)) : value
		});

		// prepare CSS
		css = width && { width: mathMax(1, mathRound(width - 2 * (labelOptions.padding || 10))) + PX };
		css = extend(css, labelOptions.style);

		// first call
		if (!defined(label)) {
			attr = {
				align: axis.labelAlign
			};
			if (isNumber(labelOptions.rotation)) {
				attr.rotation = labelOptions.rotation;
			}
			if (width && labelOptions.ellipsis) {
				attr._clipHeight = axis.len / tickPositions.length;
			}

			tick.label =
				defined(str) && labelOptions.enabled ?
					chart.renderer.text(
							str,
							0,
							0,
							labelOptions.useHTML
						)
						.attr(attr)
						// without position absolute, IE export sometimes is wrong
						.css(css)
						.add(axis.labelGroup) :
					null;

		// update
		} else if (label) {
			label.attr({
					text: str
				})
				.css(css);
		}
	}