RETURN ALL INDEXES THAT ARE INTENDED TO BE GIVEN alias, BUT HAVE NO
        ALIAS YET BECAUSE INCOMPLETE
180784
def get_prototype(self, alias):
        
        output = sort([
            a.index
            for a in self.get_aliases()
            if re.match(re.escape(alias) + "\\d{8}_\\d{6}", a.index) and not a.alias
        ])
        return output
129231
def _apply_cached_indexes(self, cached_indexes, persist=False):
        """"""
        # cacheable_dict = {}
        for elt in ['valid_input_index', 'valid_output_index',
                    'index_array', 'distance_array']:
            val = cached_indexes[elt]
            if isinstance(val, tuple):
                val = cached_indexes[elt][0]
            elif isinstance(val, np.ndarray):
                val = da.from_array(val, chunks=CHUNK_SIZE)
            elif persist and isinstance(val, da.Array):
                cached_indexes[elt] = val = val.persist()
            setattr(self.resampler, elt, val)
993805
def _get(self, target, alias):
        
        if target not in self._aliases:
            return
        return self._aliases[target].get(alias)
1029733
def resolve_aliases(self, chunks):
        '''
        
        '''
        for idx, _ in enumerate(chunks):
            new_state = self.aliases.get(chunks[idx]['state'])
            if new_state is not None:
                chunks[idx]['state'] = new_state
487020
def _get_join_indexers(self):
        
        return _get_join_indexers(self.left_join_keys,
                                  self.right_join_keys,
                                  sort=self.sort,
                                  how=self.how)
1080975
def get_index(self, index, type, alias=None, typed=None, read_only=True, kwargs=None):
        
        if kwargs.tjson != None:
            Log.error("used `typed` parameter, not `tjson`")
        if read_only:
            # GET EXACT MATCH, OR ALIAS
            aliases = wrap(self.get_aliases())
            if index in aliases.index:
                pass
            elif index in aliases.alias:
                match = [a for a in aliases if a.alias == index][0]
                kwargs.alias = match.alias
                kwargs.index = match.index
            else:
                Log.error("Can not find index {{index_name}}", index_name=kwargs.index)
            return Index(kwargs=kwargs, cluster=self)
        else:
            # GET BEST MATCH, INCLUDING PROTOTYPE
            best = self.get_best_matching_index(index, alias)
            if not best:
                Log.error("Can not find index {{index_name}}", index_name=kwargs.index)

            if best.alias != None:
                kwargs.alias = best.alias
                kwargs.index = best.index
            elif kwargs.alias == None:
                kwargs.alias = kwargs.index
                kwargs.index = best.index

            return Index(kwargs=kwargs, cluster=self)
484422
private String listIndexes(Set<IndexInfo> is) {
    if (Util.isEmpty(is)) {
      return "No indexes found";
    }

    StringBuilder res = new StringBuilder("Indexes");

    res.append("------------------------\n");

    for (IndexInfo ii: is) {
      res.append(ii.getIndexName());

      if (!Util.isEmpty(ii.getAliases())) {
        String delim = "<----";

        for (String a: ii.getAliases()) {
          res.append(delim);
          res.append(a);
          delim = ", ";
        }
      }

      res.append("\n");
    }

    return res.toString();
  }
608378
def get_alias(self, alias):
        
        alias = alias or {}
        return [k for k, v in alias.items() if self.mnemonic in v]
59433
def retrieve_import_alias_mapping(names_list):
    """"""
    import_alias_names = dict()

    for alias in names_list:
        if alias.asname:
            import_alias_names[alias.asname] = alias.name
    return import_alias_names
426761
function findAllIndices() {
  var needle = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : mandatory();
  var haystack = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : mandatory();

  var indices = [];
  for (var i = 0; i < haystack.length; i++) {
    if (haystack.substr(i, needle.length) === needle) {
      indices.push(i);
    }
  }

  if (indices.length) {
    return indices;
  } else {
    return -1;
  }
}
590314
public function getIndexInfoByAlias($alias)
    {
        $responseData = $this->db->get(['_alias', $alias]);
        if (empty($responseData)) {
            return [];
        }

        return $responseData;
    }
391542
def check_indexes(self):
        """"""
        for collection_name in INDEXES:
            existing_indexes = self.indexes(collection_name)
            indexes = INDEXES[collection_name]
            for index in indexes:
                index_name = index.document.get('name')
                if not index_name in existing_indexes:
                    logger.warning("Index {0} missing. Run command `loqusdb index`".format(index_name))
                    return
        logger.info("All indexes exists")
97370
def _chain_indices(self):
        """"""
        chain_indices = deque(range(len(self.connection_chains)))
        chain_indices.rotate(self._last_chain_index)
        return chain_indices
852724
public List<String> purgeIndexes(final Set<String> prefixes) 
          throws IndexException {
    final Set<IndexInfo> indexes = getIndexInfo();
    final List<String> purged = new ArrayList<>();

    if (Util.isEmpty(indexes)) {
      return purged;
    }

    purge:
    for (final IndexInfo ii: indexes) {
      final String idx = ii.getIndexName();

      if (!hasPrefix(idx, prefixes)) {
        continue purge;
      }

      /* Don't delete those pointed to by any aliases */

      if (!Util.isEmpty(ii.getAliases())) {
        continue purge;
      }

      purged.add(idx);
    }

    deleteIndexes(purged);

    return purged;
  }
946293
def __get_ra_index_indices(self):
        
        fragment_indices = []
        for idx, cumlen in enumerate(self._cumulative_lengths):
            cumlen_prev = self._cumulative_lengths[idx - 1] if idx > 0 else 0
            fragment_indices.append([np.argwhere(
                np.logical_and(self.ra_indices >= cumlen_prev, self.ra_indices < cumlen)
            )])
        return fragment_indices
1064106
def list_aliases(self):
        """"""

        # check alias doesn't exist
        r = self.requests.get(self.index_url + "/_alias", headers=HEADER_JSON, verify=False)
        try:
            r.raise_for_status()
        except requests.exceptions.HTTPError as ex:
            logger.warning("Something went wrong when retrieving aliases on %s.",
                           self.anonymize_url(self.index_url))
            logger.warning(ex)
            return

        aliases = r.json()[self.index]['aliases']
        return aliases
789230
def create_alias(self, alias_name):
        """"""

        return self._es_conn.indices.put_alias(index=self._es_index, name=alias_name)