Check to see if index exists.
961465
def index_exists(self):
        """"""
        headers = {'Content-Type': 'application/json', 'DB-Method': 'GET'}
        url = '/v2/exchange/db/{}/{}/_search'.format(self.domain, self.data_type)
        r = self.tcex.session.post(url, headers=headers)
        if not r.ok:
            self.tcex.log.warning('The provided index was not found ({}).'.format(r.text))
            return False
        return True
106489
protected function check_index() {

        // Check that the server is available and the index exists.
        $url = $this->engine->get_connection_url('/select?wt=json');
        $result = $this->curl->get($url);
        if ($this->curl->error) {
            throw new \moodle_exception('connectionerror', 'search_solr');
        }
        if ($this->curl->info['http_code'] === 404) {
            throw new \moodle_exception('connectionerror', 'search_solr');
        }
    }
472858
private function hasIndex($index)
    {
        return is_string($index) ? $this->hasName($index) : $this->hasPosition($index);
    }
45049
def exists(self, index, doc_type, id, **query_params):
        
        path = make_path(index, doc_type, id)
        return self._send_request('HEAD', path, params=query_params)
527248
public function hasIndex($index)
    {
        if ($index instanceof Index) {
            $index = $index->getName();
        }

        return \in_array($index, $this->_indices);
    }
199365
public function offsetExists($index)
    {
        foreach ($this->keys() as $key) {
            if ($key === $index) {
                return true;
            }
        }

        return false;
    }
360739
def has_index(self, name):
        
        name = self._normalize_identifier(name)

        return name in self._indexes
930672
@Deprecated
	public static boolean isIndexExist(Client client, String index) {
		return client.admin().indices().prepareExists(index).get().isExists();
	}
1045044
def find_by_index(self, cls, index_name, value):
        """"""
        return self._find(cls, {index_name: str(value)})
540885
public function exists($index)
    {
        $request = $this->createRequestInstance(self::INDEX_EXIST, $index, null);

        try {
            $this->client->send($request);
        } catch (ClientException $exception) {
            return false;
        }

        return true;
    }
761278
def bam_has_index(bam_file):
    """"""
    has_index = None
    with pysam.AlignmentFile(bam_file, 'rb') as bam_fileobj:
        try:
            bam_fileobj.fetch(bam_fileobj.references[0])
        except ValueError as err:
            if err.message == 'fetch called on bamfile without index':
                bam_fileobj.close()
                has_index = False
        else:
            has_index = True
    return has_index
815126
def index(self, *args, **kwargs):
        """"""
        self.check_session()
        result = self.session.index(*args, **kwargs)
        if self.autosession:
            self.commit()
        return result
561676
def countIndex(self):
		""""""
		self.data = self.index.count(self.searchString, self.category, self.math, self.game, self.searchFiles, self.extension)
474787
public boolean exists(String indexName) {
        try {
            final JestResult result = jestClient.execute(new GetSettings.Builder().addIndex(indexName).build());
            return result.isSucceeded() && Iterators.contains(result.getJsonObject().fieldNames(), indexName);
        } catch (IOException e) {
            throw new ElasticsearchException("Couldn't check existence of index " + indexName, e);
        }
    }
1046929
def find_by_index(self, cls, index_name, value):
        """"""
        table_name = cls.get_table_name()
        index_name_vals = [(index_name, value)]

        final_results = []
        for db_result in read_by_indexes(table_name, index_name_vals):
            obj = cls.from_data(db_result['value'])
            final_results.append(obj)

        return final_results
1123623
public function checkIndex(IndexUUID $indexUUID): bool
    {
        return array_key_exists($this->getIndexKey($indexUUID), $this->indices);
    }
3634
private void checkColorIndex(int index) {
    if (index < 0 || index >= mColors.length) {
      throw new IllegalArgumentException(String.format(Locale.US, "Index %d not valid", index));
    }
  }