Do we have this chunk in the index?
335123
def ChunksExist(self, chunk_numbers):
    """"""
    index_urns = {
        self.urn.Add(self.CHUNK_ID_TEMPLATE % chunk_number): chunk_number
        for chunk_number in chunk_numbers
    }

    res = {chunk_number: False for chunk_number in chunk_numbers}

    for metadata in aff4.FACTORY.Stat(index_urns):
      res[index_urns[metadata["urn"]]] = True

    return res
1051766
def looks_like_index(series, index_names=('Unnamed: 0', 'pk', 'index', '')):
    
    if series.name in index_names:
        return True
    if (series == series.index.values).all():
        return True
    if (series == np.arange(len(series))).all():
        return True
    if (
        (series.index == np.arange(len(series))).all() and
        str(series.dtype).startswith('int') and
        (series.count() == len(series))
    ):
        return True
    return False
407598
def _chunk_offsets(self):
        """"""
        index = 0
        blob_size = self.blob_properties.get('content-length')
        while index < blob_size:
            yield index
            index = index + self._chunk_size
334239
def get_index(self, bucket, index, startkey, endkey=None,
                  return_terms=None, max_results=None, continuation=None,
                  timeout=None, term_regex=None):
        
        raise NotImplementedError
37628
def allocated_chunks(self):
        
        raise NotImplementedError("%s not implemented for %s" % (self.allocated_chunks.__func__.__name__,
                                                                 self.__class__.__name__))
954295
def _check_index(self):
        """"""
        assert 0 <= self._index <= len(self._history) - 1
        # There should always be the base item at least.
        assert len(self._history) >= 1
277665
def prev_chunk(self):
        
        raise NotImplementedError("%s not implemented for %s" % (self.prev_chunk.__func__.__name__,
                                                                 self.__class__.__name__))
600271
private function ensureChunksIndex()
    {
        foreach ($this->chunksCollection->listIndexes() as $index) {
            if ($index->isUnique() && $index->getKey() === ['files_id' => 1, 'n' => 1]) {
                return;
            }
        }

        $this->chunksCollection->createIndex(['files_id' => 1, 'n' => 1], ['unique' => true]);
    }
704730
public Boolean hasIndex() {

        Boolean hasIndex = false;
        if (this.indexedFastaSequenceFile != null) {
            hasIndex = this.indexedFastaSequenceFile.isIndexed();
        }
        return hasIndex;
    }
405749
def _check_index_in_compilations(context: BaseContext, index: str):
    """"""
    compilations = 'compilations'
    if compilations not in context.shared_data:
        return False
    return index in context.shared_data[compilations]
502432
def _maybe_append_chunk(chunk_info, line_index, column, contents, chunks):
    """"""
    if chunk_info:
        chunks.append(_chunk_from_ranges(contents,
                                         chunk_info[0],
                                         chunk_info[1],
                                         line_index,
                                         column))
528895
public int prevSetBit(int index) {
        int i = index >> 6;
        final int subIndex;
        long word;
        if (i >= wlen) {
            i = wlen - 1;
            if (i < 0) return -1;
            subIndex = 63;  // last possible bit
            word = bits[i];
        } else {
            if (i < 0) return -1;
            subIndex = index & 0x3f;  // index within the word
            word = (bits[i] << (63-subIndex));  // skip all the bits to the left of index
        }

        if (word != 0) {
            return (i << 6) + subIndex - Long.numberOfLeadingZeros(word); // See LUCENE-3197
        }

        while (--i >= 0) {
            word = bits[i];
            if (word !=0 ) {
                return (i << 6) + 63 - Long.numberOfLeadingZeros(word);
            }
        }

        return -1;
    }
103987
def visit_Index(self, node: ast.Index) -> Any:
        """"""
        result = self.visit(node=node.value)

        self.recomputed_values[node] = result
        return result
519301
def current_index(self):
        """"""
        i = self._parent.proxy_model.mapToSource(self._parent.currentIndex())
        return i
604559
def GetSectionByIndex(self, section_index):
    
    if not self._is_parsed:
      self._Parse()
      self._is_parsed = True

    if section_index < 0 or section_index >= len(self._sections):
      return None

    return self._sections[section_index]
790343
def index(self, weighted=True, prune=False):
        
        warnings.warn(
            "CrunchCube.index() is deprecated. Use CubeSlice.index_table().",
            DeprecationWarning,
        )
        return Index.data(self, weighted, prune)
1057627
def get_chain(self, index):
        
        chain = []
        this = self.leaves[index]
        chain.append((this.val, 'SELF'))
        while this.p:
            chain.append((this.sib.val, this.sib.side))
            this = this.p
        chain.append((this.val, 'ROOT'))
        return chain