Get the index of the bucket that the given node would fall into.
356279
def get_bucket_for(self, node):
        
        for index, bucket in enumerate(self.buckets):
            if node.long_id < bucket.range[1]:
                return index
        # we should never be here, but make linter happy
        return None
202855
public org.tensorflow.framework.CostGraphDef.NodeOrBuilder getNodeOrBuilder(
      int index) {
    return node_.get(index);
  }
47712
static int getNodeRangeLow(int nodeOrder) {
        int level = getLevelOfNode(nodeOrder);
        int leftMostLeafOrder = getLeftMostNodeOrderOnLevel(level);
        int levelHashStep = (int) getNodeHashRangeOnLevel(level);
        int leafOrderOnLevel = nodeOrder - leftMostLeafOrder;

        return Integer.MIN_VALUE + (leafOrderOnLevel * levelHashStep);
    }
661729
function indexOfNode (host, node) {
  const chs = host.childNodes;
  const chsLen = chs.length;
  for (let a = 0; a < chsLen; a++) {
    if (chs[a] === node) {
      return a;
    }
  }
  return -1;
}
886682
def get_node(self, key):
    """"""
    if key in self.names:
      return self.values.get_member_node(key) if hasattr(self.values, 'get_member_node') else None
    return self.parent.get_node(key)
616682
private static int bucketizeValue(double wt) {
    int index;
    if (wt >= 0.0) {
      index = ((int) (wt * 10.0)) + 100;
    } else {
      index = ((int) (Math.floor(wt * 10.0))) + 100;
    }
    if (index < 0) {
      index = 201;
    } else if (index > 200) {
      index = 200;
    }
    return index;
  }
1171777
synchronized public Element get(long index) {
    int bind = ((int)index & Integer.MAX_VALUE) % buckets.length;
    Element[] bucket = buckets[bind];
    if (bucket == null)
      return null;
    for (int i = 0; i < counts[bind]; i++)
      if (bucket[i].getIndex() == index)
        return bucket[i];
    return null;
  }
887602
private int bucketIndexFor(final int value) {
    if (value < cutoff) {
      return value / interval;
    }
    int bucket = num_linear_buckets  // Skip all linear buckets.
      // And find which bucket the rest (after `cutoff') should be in.
      // Reminder: the first exponential bucket ends at 2^exp_bucket_shift.
      + log2rounddown((value - cutoff) >> exp_bucket_shift);
    if (bucket >= buckets.length) {
      return buckets.length - 1;
    }
    return bucket;
  }
398128
public int getPlacementForestIndex(DocumentURI uri) {
        return getBucketPlacementId(uri, buckets, NUM_BUCKET, forests.length,
            uForests.size());
    }
378456
def visit_index(self, node, parent):
        """"""
        newnode = nodes.Index(parent=parent)
        newnode.postinit(self.visit(node.value, newnode))
        return newnode
636688
def get_node(self, index):
        

        if not index.isValid():
            return self.__root_node
        return index.internalPointer() or self.__root_node
1025535
def _bucket_key(self):
        
        return "{}.size.{}".format(
            self.prefix, (self._hashed_key//1000)
            if self._hashed_key > 1000 else self._hashed_key)
810304
private int indexFor(int hash)
    {
        // mix the bits to avoid bucket collisions...
        hash += ~(hash << 15);
        hash ^= (hash >>> 10);
        hash += (hash << 3);
        hash ^= (hash >>> 6);
        hash += ~(hash << 11);
        hash ^= (hash >>> 16);
        return hash & (table.length - 1);
    }
640903
def get_node(self, index):
        

        index = self.mapToSource(index)
        if not index.isValid():
            return self.sourceModel().root_node

        return index.internalPointer() or self.sourceModel().root_node
762581
def get(self, index):
        """"""
        assert index <= self.count
        assert index < self.size
        offset = index * self.chunk_size
        return self.data[offset:offset + self.chunk_size]
1295290
def bucket_index(value)
      return 0 if value < @min_bucket_value
      return @number_of_buckets - 1 if value >= @max_bucket_value

      ((Math.log(value) - Math.log(@min_bucket_value)) / @bucket_size).floor
    end
832809
def get_member_node(self, key):
    """"""
    for tup, _ in self.lookups:
      if key in tup:
        return tup.get_member_node(key)
    raise RuntimeError('Key not found in composite tuple: %r' % key)