region AttributeIndex Implementation
178694
@Override
    public CompletableFuture<Void> update(@NonNull Map<UUID, Long> values, @NonNull Duration timeout) {
        ensureInitialized();
        if (values.isEmpty()) {
            // Nothing to do.
            return CompletableFuture.completedFuture(null);
        }

        Collection<PageEntry> entries = values.entrySet().stream().map(this::serialize).collect(Collectors.toList());
        return executeConditionally(tm -> this.index.update(entries, tm), timeout);
    }
1113284
function columnIndexing(selector, colNames, dtypes) {
  if (isUndefined(selector) || selector === null) {
    return null;
  }

  // Handle boolean case if applicable
  var maxLen = colNames.size();
  var boolIdxResult = attemptBoolIndexing(selector, maxLen);
  if (!isUndefined(boolIdxResult)) {
    return boolIdxResult;
  }

  // Handle integer index / col name lookup hybrid
  var opts = resolverOpts(RESOLVE_MODE.COL, maxLen,
    colNames._getIndex(), dtypes);
  return resolveSelector(selector, opts);
}
37715
private void computeAttributesIndices() {
        this.hsAttributesIndices = new HashMap<String, Integer>();
        // iterates through all existing attributes 
        // and sets an unique identifier for each one of them
        for (int i = 0; i < this.numAttributes(); i++) {
            hsAttributesIndices.put(this.attribute(i).name(), i);
        }
    }
797291
public static Fragment attributeIndex(
            @Nullable VarProperty varProperty, Variable start, Label label, Object attributeValue) {
        String attributeIndex = Schema.generateAttributeIndex(label, attributeValue.toString());
        return new AutoValue_AttributeIndexFragment(varProperty, start, attributeIndex);
    }
238763
private int getRealIndex(String qName) {
    int index = attributes.getIndex(qName);
    if (index < 0 || reverseIndex(index) < 0)
      return -1;
    return index;
  }
557375
def oindex(a, selection):
    """"""
    selection = replace_ellipsis(selection, a.shape)
    drop_axes = tuple([i for i, s in enumerate(selection) if is_integer(s)])
    selection = ix_(selection, a.shape)
    result = a[selection]
    if drop_axes:
        result = result.squeeze(axis=drop_axes)
    return result
102618
@Override
    public String getValue(int index) {
        if (index < 0 || index >= attributesList.size()) {
            return null;
        }
        return attributesList.get(index).value;
    }
530710
private void setAttributes(Map attrs, int offset) {
        if (runCount == 0) {
            createRunAttributeDataVectors();
        }

        int index = ensureRunBreak(offset, false);
        int size;

        if (attrs != null && (size = attrs.size()) > 0) {
            Vector runAttrs = new Vector(size);
            Vector runValues = new Vector(size);
            Iterator iterator = attrs.entrySet().iterator();

            while (iterator.hasNext()) {
                Map.Entry entry = (Map.Entry)iterator.next();

                runAttrs.add(entry.getKey());
                runValues.add(entry.getValue());
            }
            runAttributes[index] = runAttrs;
            runAttributeValues[index] = runValues;
        }
    }
47490
public void setAttributeValue(String attributeName, CmsEntity value, int index) {

        if (m_simpleAttributes.containsKey(attributeName)) {
            throw new RuntimeException("Attribute already exists with a simple type value.");
        }
        if (!m_entityAttributes.containsKey(attributeName)) {
            if (index != 0) {
                throw new IndexOutOfBoundsException();
            } else {
                addAttributeValue(attributeName, value);
            }
        } else {
            if (m_entityAttributes.get(attributeName).size() > index) {
                CmsEntity child = m_entityAttributes.get(attributeName).remove(index);
                removeChildChangeHandler(child);
            }
            m_entityAttributes.get(attributeName).add(index, value);
            fireChange();
        }
    }
423273
private static int findIndexOfValue(final Method method) {
        int index = 0;
        for (Annotation[] annotations : method.getParameterAnnotations()) {
            for (Annotation a : annotations) {
                if (XBValue.class.equals(a.annotationType())) {
                    return index;
                }
            }
            ++index;
        }
        return 0; // If no attribute is annotated, the first one is taken.
    }
1161220
@Deprecated
  private DatanodeDescriptor getDatanodeByIndex(int index) {
    int i = 0;
    for (DatanodeDescriptor node : datanodeMap.values()) {
      if (i == index) {
        return node;
      }
      i++;
    }
    return null;
  }
1210366
@Override
    public int getIndex(String uri, String local) {
        int length = getLength();

        for (int i = 0; i < length; i++) {
            if (!getURI(i).equals(uri)) {
                continue;
            }
            if (getLocalName(i).equals(local)) {
                return i;
            }
        }
        return -1;
    }
1367144
static String getJunctionTableIndexName(
      EntityType entityType, Attribute attr, Attribute idxAttr) {
    String indexNamePostfix = "_idx";
    int nrAdditionalChars = 1 + indexNamePostfix.length();
    String entityPart =
        generateId(entityType, (MAX_IDENTIFIER_BYTE_LENGTH - nrAdditionalChars) / 3);
    String attrPart = generateId(attr, (MAX_IDENTIFIER_BYTE_LENGTH - nrAdditionalChars) / 3);
    String idxAttrPart = generateId(idxAttr, (MAX_IDENTIFIER_BYTE_LENGTH - nrAdditionalChars) / 3);
    return getQuotedIdentifier(entityPart + '_' + attrPart + '_' + idxAttrPart + indexNamePostfix);
  }
910165
@SuppressWarnings("unused")
    private int cordToIndex(DataPointPair<Integer> dataPoint)
    {
        DataPoint dp = dataPoint.getDataPoint();
        int index = 0;
        for(int i = 0; i < dimSize.length; i++)
            index = dp.getCategoricalValue(realIndexToCatIndex[i]) + dimSize[i]*index;
        return index;
    }
809634
private int getDataMemberListIndex(Member member) {
        final Collection<Member> dataMembers = nodeEngine.getClusterService().getMembers(DATA_MEMBER_SELECTOR);
        int index = -1;
        for (Member dataMember : dataMembers) {
            index++;
            if (dataMember.equals(member)) {
                return index;
            }
        }
        return index;
    }
972351
function _getIndexesInArray(attrs, attr) {
    var res = [];

    for (var i = 0; i < attrs.length; i++) {
        if (attrs[i].name === attr) res.push(i);
    }

    return res;
}
382478
@Override
    public String getLocalName(int index) {
        if (index < 0 || index >= attributesList.size()) {
            return null;
        }
        Attribute attr = attributesList.get(index);
        // FIXME attr.localName is sometimes null, why?
        if (namespaces && attr.localName == null) {
            // XXX fix this here for now
            int ci = attr.name.indexOf(':');
            attr.localName = (ci == -1) ? attr.name
                    : attr.name.substring(ci + 1);
        }
        return (attr.localName == null) ? "" : attr.localName;
    }