minimap2 can build indexes on the fly but will also store commons ones.
972220
def remap_index_fn(ref_file):
    
    index_dir = os.path.join(os.path.dirname(ref_file), os.pardir, "minimap2")
    if os.path.exists(index_dir) and os.path.isdir(index_dir):
        return index_dir
    else:
        return os.path.dirname(ref_file)
1009112
private void saveFeatureIndexes(FeatureIndex[] index, ZipModel model) throws IOException
	{
		logger.info(" (" + index.length + ")");

		// save the indexes
		for (int i=0;i<index.length;i++)
		{
			logger.debug("dic" + i + " size " + index[i].size());

			File tmp = File.createTempFile("dic" + i, null);
			tmp.deleteOnExit();

			BufferedWriter bwd = new BufferedWriter(new FileWriter(tmp));
			index[i].write(bwd);
			bwd.close();

			// add the dictionary to the model
			model.add(tmp, "dic" + i);
		} // end for
	}
1331205
function createIndices(callback) {
      const q = queue();
      geojson_files.forEach((gj) => {
        q.defer(createIndex, gj);
      });

      q.awaitAll((err) => {
        if (err) return callback(err);
        return callback();
      });
    }
1119533
protected static MutableRoaringBitmap lazyorfromlazyinputs(final MutableRoaringBitmap x1,
      final MutableRoaringBitmap x2) {
    final MutableRoaringBitmap answer = new MutableRoaringBitmap();
    MappeableContainerPointer i1 = x1.highLowContainer.getContainerPointer();
    MappeableContainerPointer i2 = x2.highLowContainer.getContainerPointer();
    main: if (i1.hasContainer() && i2.hasContainer()) {
      while (true) {
        if (i1.key() == i2.key()) {
          MappeableContainer c1 = i1.getContainer();
          MappeableContainer c2 = i2.getContainer();
          if ((c2 instanceof MappeableBitmapContainer)
              && (!(c1 instanceof MappeableBitmapContainer))) {
            MappeableContainer tmp = c1;
            c1 = c2;
            c2 = tmp;
          }
          answer.getMappeableRoaringArray().append(i1.key(), c1.lazyIOR(c2));
          i1.advance();
          i2.advance();
          if (!i1.hasContainer() || !i2.hasContainer()) {
            break main;
          }
        } else if (Util.compareUnsigned(i1.key(), i2.key()) < 0) { // i1.key() < i2.key()
          answer.getMappeableRoaringArray().append(i1.key(), i1.getContainer());
          i1.advance();
          if (!i1.hasContainer()) {
            break main;
          }
        } else { // i1.key() > i2.key()
          answer.getMappeableRoaringArray().append(i2.key(), i2.getContainer());
          i2.advance();
          if (!i2.hasContainer()) {
            break main;
          }
        }
      }
    }
    if (!i1.hasContainer()) {
      while (i2.hasContainer()) {
        answer.getMappeableRoaringArray().append(i2.key(), i2.getContainer());
        i2.advance();
      }
    } else if (!i2.hasContainer()) {
      while (i1.hasContainer()) {
        answer.getMappeableRoaringArray().append(i1.key(), i1.getContainer());
        i1.advance();
      }
    }
    return answer;
  }
575773
private void createIndex(long idleTime) {
        try {
            this.sessions.createIndex(
                    new Document(SESSION_TTL, 1),
                    new IndexOptions()
                    .expireAfter(idleTime, TimeUnit.SECONDS)
                    .name(SESSION_INDEX_NAME));
        } catch (MongoException ex) {//update idle time
            this.sessions.dropIndex(SESSION_INDEX_NAME);
            this.sessions.createIndex(
                    new Document(SESSION_TTL, 1),
                    new IndexOptions()
                    .expireAfter(idleTime, TimeUnit.SECONDS)
                    .name(SESSION_INDEX_NAME));
        }
    }
592892
function indexProperties(obj) {
	if (!obj)
		return;
	if (obj.propertyMap)
		return;
	obj.propertyMap = new Map;
	obj.properties.forEach(function(prty) {
		obj.propertyMap.put(prty.name, prty);
	})
	if (!obj.prototype)
		return;
	var parent = lookupObject(obj.prototype.key);
	indexProperties(parent)
	parent.propertyMap.forEach(function(name,prty) {
		if (!obj.propertyMap.has(name)) {
			obj.propertyMap.put(name,prty);
		}
	})
}
143513
private int[] buildIndex(final int[] counts, int[] positions, int minsupp) {
    // Count the number of frequent items:
    int numfreq = 0;
    for(int i = 0; i < counts.length; i++) {
      if(counts[i] >= minsupp) {
        ++numfreq;
      }
    }
    // Build the index table
    int[] idx = new int[numfreq];
    for(int i = 0, j = 0; i < counts.length; i++) {
      if(counts[i] >= minsupp) {
        idx[j++] = i;
      }
    }
    IntegerArrayQuickSort.sort(idx, (x, y) -> Integer.compare(counts[y], counts[x]));
    Arrays.fill(positions, -1);
    for(int i = 0; i < idx.length; i++) {
      positions[idx[i]] = i;
    }
    return idx;
  }
663771
function (runtime, modNames, refModName) {
            var ret = [], i, l;
            if (modNames) {
                // 1. index map
                for (i = 0, l = modNames.length; i < l; i++) {
                    // conditional loader
                    // requires:[window.localStorage?"local-storage":""]
                    if (modNames[i]) {
                        ret.push(pluginAlias(runtime, indexMap(modNames[i])));
                    }
                }
            }
            // 2. relative to absolute (optional)
            if (refModName) {
                ret = Utils.normalDepModuleName(refModName, ret);
            }
            return ret;
        }
411709
static Iterable<ImmutableBitmap> bitmapsFromIndexes(final IntIterable indexes, final BitmapIndex bitmapIndex)
  {
    // Do not use Iterables.transform() to avoid boxing/unboxing integers.
    return new Iterable<ImmutableBitmap>()
    {
      @Override
      public Iterator<ImmutableBitmap> iterator()
      {
        final IntIterator iterator = indexes.iterator();

        return new Iterator<ImmutableBitmap>()
        {
          @Override
          public boolean hasNext()
          {
            return iterator.hasNext();
          }

          @Override
          public ImmutableBitmap next()
          {
            return bitmapIndex.getBitmap(iterator.nextInt());
          }

          @Override
          public void remove()
          {
            throw new UnsupportedOperationException();
          }
        };
      }
    };
  }
929582
function setupIndexFunctions (InstanceModel) {
  if (InstanceModel && InstanceModel.schema && InstanceModel.schema.indexes) {
    const indexes = InstanceModel.schema.indexes
    let v
    for (v in indexes) {
      if (indexes.hasOwnProperty(v)) {
        const path = indexes[v].path
        const name = indexes[v].name
        const fnName = 'findBy'.concat(inflection.camelize(inflection.underscore(name)))
        const indexFind = generateIndexFinder(InstanceModel, path, name)
        InstanceModel[fnName] = function () {
          return promisifyCall(this, indexFind, ...arguments)
        }
      }
    }
  }
}
786866
private static <K, V> List<KeyValue<K, List<V>>> multimapToList(
      Marshaller<K> keyMarshaller, ListMultimap<Bytes, V> in) {
    List<Bytes> keys = Ordering.natural().sortedCopy(in.keySet());
    ImmutableList.Builder<KeyValue<K, List<V>>> out = ImmutableList.builder();
    for (Bytes keyBytes : keys) {
      K key = keyMarshaller.fromBytes(ByteBuffer.wrap(keyBytes.bytes));
      out.add(KeyValue.of(key, in.get(keyBytes)));
    }
    return out.build();
  }
950710
function (indexMap, loadOrder) {
                // In older versions indexMap was an object instead of a sparse array
                if (!('length' in indexMap)) {
                    var indexArray = [],
                        index;
                    
                    for (index in indexMap) {
                        if (!isNaN(+index)) {
                            indexArray[+index] = indexMap[index];
                        }
                    }
                    
                    indexMap = indexArray;
                }
                
                return Request.prototype.getPathsFromIndexes(indexMap, loadOrder);
            }
910918
private IndexMetadata buildModernIndex(
      CqlIdentifier keyspaceId, CqlIdentifier tableId, AdminRow row) {
    CqlIdentifier name = CqlIdentifier.fromInternal(row.getString("index_name"));
    IndexKind kind = IndexKind.valueOf(row.getString("kind"));
    Map<String, String> options = row.getMapOfStringToString("options");
    String target = options.get("target");
    return new DefaultIndexMetadata(keyspaceId, tableId, name, kind, target, options);
  }
221892
function minifyApp(appNameMap, appContentMap) {
  let file = config.distDir + 'app.wxss';
  if (!utils.isFile(file)) {
    return;
  }
  let minified = new CleanCSS({ keepBreaks: true }).minify(fs.readFileSync(file, 'utf8')).styles;
  minified = minified.replace(/::?(after|before|first\-child|last\-child)/g, ':$1');
  let finalCssContent = '';
  minified.split('\n').forEach((line) => {
    let index = line.indexOf('{');
    let selectors = line.substr(0, index).split(',');
    let content = line.substr(index);

    selectors.forEach((selector) => {
      if (selector[0] !== '.') {
        finalCssContent += selector + content + '\n';
        return;
      }
      let className = selector.substr(1);
      if (!appNameMap[className]) {
        appNameMap[className] = {
          id: '',
          contents: []
        };
      }
      appNameMap[className].contents.push(content);
      if (!appContentMap[content]) {
        appContentMap[content] = [];
      }
      appContentMap[content].push(className);
    });
  });

  return function () {
    //console.log(appNameMap, appContentMap);
    console.log('minify'.green, path.normalize('dist/app.wxss').blue);
    for (let key in appNameMap) {
      let matchs = key.match(/(.*):+(after|before|first\-child|last\-child)$/);
      if (matchs && appNameMap[matchs[1]] && appNameMap[matchs[1]].id) {
        appNameMap[key].id = appNameMap[matchs[1]].id + ':' + matchs[2];
      }
    }
    for (let c in appContentMap) {
      let keys = [];
      appContentMap[c].forEach((key) => {
        if (appNameMap[key].id) {
          keys.push('.' + appNameMap[key].id);
          console.log(('\t.' + key).blue, '->', ('.' + appNameMap[key].id).cyan);
        } else if (config.classNames && config.classNames[key]) {
          keys.push('.' + key);
          console.log(('\t.' + key).blue, '->', ('.' + key).cyan);
        }
      });
      if (keys.length) {
        finalCssContent += keys.join(',') + c + '\n';
      }
    }
    finalCssContent = new CleanCSS({ keepBreaks: true }).minify(finalCssContent).styles;
    fs.writeFileSync(file, finalCssContent);
  };
}
1371761
def build_index(self, idx_name, _type='default'):
        ""
        indexes = {}
        has_non_string_values = False
        for key, item in self.data.items():
            if idx_name in item:
                value = item[idx_name]
                # A non-string index value switches it into a lazy one.
                if not isinstance(value, six.string_types):
                    has_non_string_values = True
                if value not in indexes:
                    indexes[value] = set([])
                indexes[value].add(key)
        self.indexes[idx_name] = indexes
        if self._meta.lazy_indexes or has_non_string_values:
            # Every index is lazy
            _type = 'lazy'
        self.index_defs[idx_name] = {'type': _type}
935794
function createIndex() {
  var directory = 'src/views'
  var directories = fs.readdirSync(directory)

  try {
    var lines = ['// This is a generated file, do not edit, or disable "prebuild" command in package.json if you want to take control']
    for (var i = 0; i < directories.length; i++) {
      var path = directory + '/' + directories[i];
      if (fs.existsSync(path) && fs.lstatSync(path).isDirectory()) {
        var file = directories[i] + '.js'
        if (fs.existsSync(directory + '/' + directories[i] + '/' + file)) {
          lines.push('export { default as ' + directories[i] + ' } from \'./' + directories[i] + '/' + directories[i] + '\'')
        }
      }
    }

    fs.writeFileSync(directory + '/index.js', lines.join('\n') + '\n');
  } catch (err) {
    console.log(err)
  }
}
9719
def []=(indexes, value)
      indexes = [indexes] unless indexes.is_a?(Range)

      indexes.each do |index|
        process_non_terminals(index)

        if @map.has_key?(index)
          fail MiniTermKME, "Duplicate entry #{index.inspect}"
        end

        @map[index] = [value, index]
      end
    end