add answer with specific index
968994
public boolean add(ConceptMap answer, ConceptMap answerIndex){
        Index ind = Index.of(answerIndex.vars());
        if (ind.equals(index)) {
            return indexedAnswers.put(answerIndex, answer);
        }
        throw new IllegalStateException("Illegal index: " + answerIndex + " indices: " + index);
    }
395799
def update_index(self, name, value):
        
        kwargs = {}
        kwargs['index.' + name] = value if isinstance(value, basestring) else json.dumps(value)
        return self.post(**kwargs)
43147
def start_index(self, value):
        """"""
        # TODO: Validate contents?  (May want to set before adding the data.)
        if not isinstance(value, dict):
            raise TypeError('start_index attribute must be a dict.')
        self._start_index = value
761047
public static int indexAny(String target, Integer fromIndex, String... indexWith) {
		return indexAny(target, fromIndex, Arrays.asList(indexWith));
	}
745459
function(index) {
      index = Math.min(index, this.length);
      arguments.length > 1
      && this.splice.apply(this, [index, 0].concat([].pop.call(arguments)))
      && this.insert.apply(this, arguments);
      return this;
    }
171538
function addNum(arr, num, index = 0) {
  if (arr[index] == undefined) arr[index] = 0;
  arr[index] += num;
}
561676
def countIndex(self):
		""""""
		self.data = self.index.count(self.searchString, self.category, self.math, self.game, self.searchFiles, self.extension)
379349
def add_index_alias(es, index_name, alias_name):
    """"""

    es.indices.put_alias(index=index_name, name=terms_alias)
500050
function raiseIndex() {
        index++;

        // If queued remove the previous bench.
        if (queued && index > 0) {
          shift.call(benches);
        }
        // If we reached the last index then return `false`.
        return (queued ? benches.length : index < result.length)
          ? index
          : (index = false);
      }
997638
def id_index 
      @terms.inject({}) {|sum, t| sum.update(t.id.value => t)}
    end
295470
private void addMissingBlanks(final int index) {
        if (this.capacity <= index) {
            this.capacity = index * 2;
            final E[] newArr = (E[]) new Object[this.capacity];
            System.arraycopy(this.arr, 0, newArr, 0, this.size);
            this.arr = newArr;
        }
        if (this.blankElement != null) {
            Arrays.fill(this.arr, this.size, index, this.blankElement);
        }
        this.size = index + 1;
    }
783618
def atIndices(indexable, indices, default=__unique):
    
    """
    if default is __unique:
        return [indexable[i] for i in indices]
    else:
        res = []
        for i in indices:
            try:
                res.append(indexable[i])
            except (IndexError, KeyError):
                res.append(default)
        return res
69048
@TimerJ
    public TableMetadataBuilder addIndex(IndexMetadata indexMetadata) {
        indexes.put(indexMetadata.getName(), indexMetadata);
        return this;
    }
12094
function (item, req, eachReq, res, next) {
          eachReq.item = item;
          eachReq[indexKey] = index;
          index++;
          next();
        }
208831
function incrementIndex (inc, focus) {
    var newIndex,
        key   = focus ? 'focusIndex' : 'selectedIndex',
        index = ctrl[ key ];
    for (newIndex = index + inc;
         ctrl.tabs[ newIndex ] && ctrl.tabs[ newIndex ].scope.disabled;
         newIndex += inc) { /* do nothing */ }

    newIndex = (index + inc + ctrl.tabs.length) % ctrl.tabs.length;

    if (ctrl.tabs[ newIndex ]) {
      ctrl[ key ] = newIndex;
    }
  }
54165
public function addIndex($type, $index)
    {
        if (!isset($this->indexes[$type])) {
            $this->indexes[$type] = [];
        }

        $this->indexes[$type][] = $index;
    }
689058
def add(self, index, value):
        
        self.buf.append(value)
        if (index - self.flush_at) < self.interval:
            return
        value = np.mean(self.buf)
        if self.verbose:
            logger.info("iter={} {{{}}}={}".format(index, self.name, value))
        if self.fd is not None:
            print("{} {:g}".format(index, value), file=self.fd)
        self.flush_at = index
        self.buf = []