Check if a type/types exists in the index.

        Any additional keyword arguments will be passed to
        ``Elasticsearch.indices.exists_type`` unchanged.
776045
def exists_type(self, using=None, **kwargs):
        
        return self._get_connection(using).indices.exists_type(index=self._name, **kwargs)
368860
def _check_type(self, ref, value):
        
        if isinstance(value, list):
            return [self._check_type(ref, val) for val in value]

        model_type = self.cube.model[ref].datatype
        if model_type is None:
            return
        query_type = self._api_type(value)
        if query_type == model_type:
            return
        else:
            raise QueryException("Invalid value %r parsed as type '%s' "
                                 "for cut %s of type '%s'"
                                 % (value, query_type, ref, model_type))
1326503
def is_type(type_, *p):
    
    try:
        for i in p:
            if i.type_ != type_:
                return False

        return True
    except:
        pass

    return False
1223569
def index(self, type_: Type[T]) -> int:
        
        for i, cond in ((q[0], q[1][0]) for q in enumerate(self.handlers)):
            try:
                match = cond(type_)
            except:
                if self.raiseconditionerrors:
                    raise
                match = False
            if match:
                return i
        raise ValueError('No matching condition found')
1236327
def exists(self, obj_id, obj_type=None):
        
        return self.object_key(obj_id, obj_type) in self._data
1031103
def exists(config):
    
    exists = (
        pathlib.Path(config.cache_path).exists()
        and pathlib.Path(config.cache_path).is_dir()
    )
    if not exists:
        return False
    index_path = pathlib.Path(config.cache_path) / "index.json"
    if index_path.exists():
        with open(index_path, "r") as out:
            index = json.load(out)
        if index["version"] != __version__:
            # TODO: Inspect the versions properly.
            logger.warning(
                "Wily cache is old, you may incur errors until you rebuild the cache."
            )
    else:
        logger.warning(
            "Wily cache was not versioned, you may incur errors until you rebuild the cache."
        )
        create_index(config)
    return True
337832
def known_type?(key)
      return false unless key
      key &&= key.to_s.to_sym
      Rudy::ID_MAP.has_key?(key)
    end
136758
def find_types(observatory, match=None, trend=None,
               connection=None, **connection_kw):
    
    return sorted(connection.find_types(observatory, match=match),
                  key=lambda x: _type_priority(observatory, x, trend=trend))
749548
def does_sqlatype_require_index_len(
        coltype: Union[TypeEngine, VisitableType]) -> bool:
    
    coltype = _coltype_to_typeengine(coltype)
    if isinstance(coltype, sqltypes.Text):
        return True
    if isinstance(coltype, sqltypes.LargeBinary):
        return True
    return False
148185
def _check_type(name, obj, expected_type):
    
    if not isinstance(obj, expected_type):
        raise TypeError(
            '"%s" must be an a %s' % (name, expected_type.__name__)
        )
1045274
private List<String> diagnoseIndexMismatch(Index theIndex, Index otherIndex) {
        List<String> mismatchedAttrs = new ArrayList<>();

        // Pairs of matching indexes must agree on type (int hash, etc.).
        if (theIndex.getType() != otherIndex.getType()) {
            mismatchedAttrs.add("index type (hash vs tree)");
        }

        // Pairs of matching indexes must agree whether they are (assume)unique.
        if (theIndex.getUnique() != otherIndex.getUnique() ||
                theIndex.getAssumeunique() != otherIndex.getAssumeunique()) {
            mismatchedAttrs.add("UNIQUE attribute");
        }

        // Pairs of matching indexes must agree whether they are partial
        // and if so, agree on the predicate.
        String thePredicateJSON = theIndex.getPredicatejson();
        String otherPredicateJSON = otherIndex.getPredicatejson();
        if (thePredicateJSON == null) {
            if (otherPredicateJSON != null) {
                mismatchedAttrs.add("WHERE predicate");
            }
        }
        else if ( ! thePredicateJSON.equals(otherPredicateJSON)) {
            mismatchedAttrs.add("WHERE predicate");
        }

        // Pairs of matching indexes must agree that they do or do not index
        // expressions and, if so, agree on the expressions.
        String theExprsJSON = theIndex.getExpressionsjson();
        String otherExprsJSON = otherIndex.getExpressionsjson();
        if (theExprsJSON == null) {
            if (otherExprsJSON != null) {
                mismatchedAttrs.add("indexed expression");
            }
        }
        else if ( ! theExprsJSON.equals(otherExprsJSON)) {
            mismatchedAttrs.add("indexed expression");
        }


        // Indexes must agree on the columns they are based on,
        // identifiable by the columns' order in the table.
        CatalogMap<ColumnRef> theColumns = theIndex.getColumns();
        int theColumnCount = theColumns.size();
        CatalogMap<ColumnRef> otherColumns = otherIndex.getColumns();
        if (theColumnCount != otherColumns.size() ) {
            mismatchedAttrs.add("indexed expression");
        }

        Iterator<ColumnRef> theColumnIterator = theColumns.iterator();
        Iterator<ColumnRef> otherColumnIterator = otherColumns.iterator();
        for (int ii = 0 ;ii < theColumnCount; ++ii) {
            int theColIndex = theColumnIterator.next().getColumn().getIndex();
            int otherColIndex = otherColumnIterator.next().getColumn().getIndex();
            if (theColIndex != otherColIndex) {
                mismatchedAttrs.add("indexed expression");
            }
        }

        return mismatchedAttrs;
    }
285055
private function exists($index)
    {
        return isset($this->elements[$index]) || array_key_exists($index, $this->elements);
    }
864921
def __search(self, value, type_attribute):
        
        results = []
        if not value:
            raise EmptySearchtermError
        for idx, connection in enumerate(self.misp_connections):
            misp_response = connection.search(type_attribute=type_attribute, values=value)

            # Fixes #94
            if isinstance(self.misp_name, list):
                name = self.misp_name[idx]
            else:
                name = self.misp_name

            results.append({'url': connection.root_url,
                            'name': name,
                            'result': self.__clean(misp_response)})
        return results
1096817
function exists(path, type) {
	try {
		switch (type){
			case "d": return FS.statSync(path).isDirectory();
			default:  return FS.statSync(path).isFile();
		}
	}
	catch (err) {
		return false;
	}
}
984206
def _check_field_type(self, pkt, index):
        
        my_idx = pkt.fields_desc.index(self)
        try:
            next_field = pkt.fields_desc[my_idx + index]
            if type(next_field) is not LEBitField and \
               next_field.__class__.__base__ is not LEBitField:
                raise LEBitFieldSequenceException('field after field {} must '
                                                  'be of type LEBitField or '
                                                  'derived classes'.format(self.name))  # noqa: E501
        except IndexError:
            # no more fields -> error
            raise LEBitFieldSequenceException('Missing further LEBitField '
                                              'based fields after field '
                                              '{} '.format(self.name))
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);
        }
    }
928345
def exists(self, index):
        
        data = self.data
        try:
            for c in self._split(index):
                i = int(c) - 1
                data = data[i][4]
        except Exception:
            return False
        return True