Integer is label's Index from labelIndexer
333209
@Override
    public Map<String, Double> predict(Tuple predict) {
        Map<Integer, Double> labelProb = new HashMap<>();
        for (Integer labelIndex : model.labelIndexer.getIndexSet()) {
            double likelihood = 1.0D;

            for (int i = 0; i < predict.vector.getVector().length; i++) {
                double fi = predict.vector.getVector()[i];
                likelihood = likelihood * VectorUtils.gaussianPDF(model.meanVectors[labelIndex][i], model.varianceVectors[labelIndex][i], fi);
            }

            double posterior = model.labelPrior.get(labelIndex) * likelihood; // prior*likelihood, This is numerator of posterior
            labelProb.put(labelIndex, posterior);
        }

        double evidence = labelProb.values().stream().reduce((e1, e2) -> e1 + e2).orElse(-1D);
        if (evidence == -1) {
            LOG.error("Evidence is Empty!");
            return new HashMap<>();
        }

        labelProb.entrySet().forEach(entry -> {
            double prob = entry.getValue() / evidence;
            labelProb.put(entry.getKey(), prob);
        }); // This is denominator of posterior

        Map<String, Double> result = model.labelIndexer.convertMapKey(labelProb);

        if (predict.label == null || predict.label.isEmpty()) { // Just for write to predict tuple.
            predict.label = result.entrySet().stream().max((e1, e2) -> e1.getValue().compareTo(e2.getValue())).map(Entry::getKey).orElse(StringUtils.EMPTY);
        }
        return result;
    }
1298169
def _get_label(self, axis):
        """"""

        if axis == 'x':
            colname = self.x_col
        else:  # y
            colname = self.y_col

        if colname == self._idxname:
            label = 'Index'
        else:
            col = self.tab[colname]
            if col.unit:
                label = '{0} ({1})'.format(col.name, col.unit)
            else:
                label = col.name

        return label
879632
def check(labels):
        
        # type checking
        if not isinstance(labels, list):
            raise IOError('labels are not in a list')
        if not len(labels):
            raise IOError('the labels list is empty')
        if not all([isinstance(l, np.ndarray) for l in labels]):
            raise IOError('all labels must be numpy arrays')

        # dimension checking
        ndim = labels[0].ndim
        if ndim not in [1, 2]:
            raise IOError('labels dimension must be 1 or 2')
        if not all([l.ndim == ndim for l in labels]):
            raise IOError('all labels dimensions must be equal')
        if ndim == 2:
            shape1 = labels[0].shape[1]
            if not all([l.shape[1] == shape1 for l in labels]):
                raise IOError('all labels must have same shape on 2nd dim')

        # sort checking
        for label in labels:
            index = (np.argsort(label) if label.ndim == 1
                     else np.lexsort(label.T))
            # print label, index
            # print len(index), label.shape[0]
            assert len(index) == label.shape[0]
            if not all(n == index[n] for n in range(label.shape[0]-1)):
                raise IOError('labels are not sorted in increasing order')
172159
function(value, index, datasetIndex, includeOffset) {
			var me = this;
			// 1 is added because we need the length but we have the indexes
			var offsetAmt = Math.max((me.maxIndex + 1 - me.minIndex - ((me.options.gridLines.offsetGridLines) ? 0 : 1)), 1);

			if (value !== undefined && isNaN(index)) {
				var labels = me.getLabels();
				var idx = labels.indexOf(value);
				index = idx !== -1 ? idx : index;
			}

			if (me.isHorizontal()) {
				var innerWidth = me.width - (me.paddingLeft + me.paddingRight);
				var valueWidth = innerWidth / offsetAmt;
				var widthOffset = (valueWidth * (index - me.minIndex)) + me.paddingLeft;

				if (me.options.gridLines.offsetGridLines && includeOffset || me.maxIndex === me.minIndex && includeOffset) {
					widthOffset += (valueWidth / 2);
				}

				return me.left + Math.round(widthOffset);
			}
			var innerHeight = me.height - (me.paddingTop + me.paddingBottom);
			var valueHeight = innerHeight / offsetAmt;
			var heightOffset = (valueHeight * (index - me.minIndex)) + me.paddingTop;

			if (me.options.gridLines.offsetGridLines && includeOffset) {
				heightOffset += (valueHeight / 2);
			}

			return me.top + Math.round(heightOffset);
		}
815733
private long getIndex(T x, T y) {
        int i = elementIndices.index(x);
        int j = elementIndices.index(y);
        long index = (((long)i) << 32) | j;
        return index;
    }
1076117
function(label) {

		var result = [],
			i = 0;

		for (; i < this._count; i++) {

			if (this._content[i].isView && this._content[i].label == label) {

				result.push(this._content[i]);

			}

		}

		return result;

	}
143802
private void computeLabelsIndex(final FSA fsa) {
    // Compute labels count.
    final int[] countByValue = new int[256];

    fsa.visitAllStates(new StateVisitor() {
      public boolean accept(int state) {
        for (int arc = fsa.getFirstArc(state); arc != 0; arc = fsa.getNextArc(arc))
          countByValue[fsa.getArcLabel(arc) & 0xff]++;
        return true;
      }
    });

    // Order by descending frequency of counts and increasing label value.
    Comparator<IntIntHolder> comparator = new Comparator<IntIntHolder>() {
      public int compare(IntIntHolder o1, IntIntHolder o2) {
        int countDiff = o2.b - o1.b;
        if (countDiff == 0) {
          countDiff = o1.a - o2.a;
        }
        return countDiff;
      }
    };

    TreeSet<IntIntHolder> labelAndCount = new TreeSet<IntIntHolder>(comparator);
    for (int label = 0; label < countByValue.length; label++) {
      if (countByValue[label] > 0) {
        labelAndCount.add(new IntIntHolder(label, countByValue[label]));
      }
    }

    labelsIndex = new byte[1 + Math.min(labelAndCount.size(), CFSA2.LABEL_INDEX_SIZE)];
    labelsInvIndex = new int[256];
    for (int i = labelsIndex.length - 1; i > 0 && !labelAndCount.isEmpty(); i--) {
      IntIntHolder p = labelAndCount.first();
      labelAndCount.remove(p);
      labelsInvIndex[p.a] = i;
      labelsIndex[i] = (byte) p.a;
    }
  }
416311
def get_label_idx(self, label):
        
        for i in range(len(self)):
            if self.mem[i].is_label and self.mem[i].inst == label:
                return i

        return None
522199
public void selectByLabel(String[] labels) {
        for (int i = 0; i < labels.length; i++) {
            selectByLabel(labels[i]);
        }
    }
465871
function (dataIndex, status) {
        var text = formatUtil.getFormattedLabel(this, dataIndex, status);
        if (text == null) {
            text = this.getData().getName(dataIndex);
        }
        return text;
    }
968282
public Integer getValueInteger(String label) {
        PrimitiveObject o = getPrimitiveObject(VALUE, label, ObjectUtil.INTEGER, "Integer");
        if (o == null) {
            return null;
        }
        return (Integer) o.getObject();
    }
260390
function adjustLabelPosition(label, x, y, index) {
  const bbox = label.getBBox();
  const width = bbox.width;
  const height = bbox.height;
  const attrs = {
    x,
    y,
    textAlign: 'center'
  };
  switch (index) {
    case 0:
      attrs.y -= height / 2;
      attrs.textAlign = 'left';
      break;
    case 1:
      attrs.y -= height / 2;
      attrs.textAlign = 'right';
      break;
    case 2:
      attrs.y += height / 2;
      attrs.textAlign = 'right';
      break;
    case 3:
      attrs.y += height / 2;
      attrs.textAlign = 'left';
      break;
    case 5:
      attrs.y -= height / 2;
      break;

    case 6:
      attrs.y += height / 2;
      break;
    case 7:
      attrs.x += width / 2;
      attrs.textAlign = 'left';
      break;
    case 8:
      attrs.x -= width / 2;
      attrs.textAlign = 'right';
      break;
    default:break;
  }
  label.attr(attrs);
  return label.getBBox();
}
925196
def index_labels_to_array(labels, dtype=None):
    
    if isinstance(labels, (str, tuple)):
        labels = [labels]

    if not isinstance(labels, (list, np.ndarray)):
        try:
            labels = list(labels)
        except TypeError:  # non-iterable
            labels = [labels]

    labels = asarray_tuplesafe(labels, dtype=dtype)

    return labels
1056104
def label_with_id(label_id, options = {})
        if options && options[:index] then
          elements = find_elements(:id, label_id.to_s)
          elements[options[:index].to_i - 1].text
          # label(:id => label_id.to_s, :index => options[:index]).text
        else
          find_element(:id, label_id.to_s).text
        end
      end
885487
private int getPrototypeIndex(Renderer renderer) {
    int index = 0;
    for (Renderer prototype : prototypes) {
      if (prototype.getClass().equals(renderer.getClass())) {
        break;
      }
      index++;
    }
    return index;
  }
1033944
def IntegerAbs(input_vertex: vertex_constructor_param_types, label: Optional[str]=None) -> Vertex:
    
    return Integer(context.jvm_view().IntegerAbsVertex, label, cast_to_integer_vertex(input_vertex))
1278535
private String indexLabel(Entry child)
                    throws ObjectManagerException
    {
        // Step up the tree until we reach the root.
        String indexLabel = "";
        for (Entry parent = (Entry) child.getParent(); parent != null; parent = (Entry) child.getParent()) {
            if (parent.getLeft() == child)
                indexLabel = "L," + indexLabel;
            else if (parent.getRight() == child)
                indexLabel = "R," + indexLabel;
            else
                indexLabel = "Invalid," + indexLabel;
            child = parent;
        } // for...
        return indexLabel;
    }