Retrieve the statistic of one or more indices
        (See :ref:`es-guide-reference-api-admin-indices-stats`)

        :keyword indices: an index or a list of indices
170955
def stats(self, indices=None):
        
        path = self.conn._make_path(indices, (), "_stats")
        return self.conn._send_request('GET', path)
212573
def stats_list(list = nil, date = nil)
      data = {}
      if list != nil
        data[:list] = list
      end
      if date != nil
        data[:date] = date
      end
      data[:stat] = 'list'
      api_get(:stats, data)
    end
481128
def get_indexes(self, schema, **kwargs):
        
        with self.connection(**kwargs) as connection:
            kwargs['connection'] = connection
            return self._get_indexes(schema, **kwargs)
418043
def get_index(index_name, *partition_indices):  # pragma: no cover
    """"""
    index = partition_indices[0].append(partition_indices[1:])
    index.names = index_name
    return index
1359105
def keyword_informations(keyword, options={})
      response = connection.get do |req|
        req.url "insight/keywords/#{keyword}", options
      end
      return_error_or_body(response)
    end
1162695
def _collect_indexes_stats(self, instance, db, tags):
        
        for coll_name in instance.get('collections', []):
            try:
                for stats in db[coll_name].aggregate([{"$indexStats": {}}], cursor={}):
                    idx_tags = tags + [
                        "name:{0}".format(stats.get('name', 'unknown')),
                        "collection:{0}".format(coll_name),
                    ]
                    val = int(stats.get('accesses', {}).get('ops', 0))
                    self.gauge('mongodb.collection.indexes.accesses.ops', val, idx_tags)
            except Exception as e:
                self.log.error("Could not fetch indexes stats for collection %s: %s", coll_name, e)
1166196
def summary_pairwise_indices(self):
        """"""
        summary_pairwise_indices = np.empty(
            self.values[0].t_stats.shape[1], dtype=object
        )
        summary_pairwise_indices[:] = [
            sig.summary_pairwise_indices for sig in self.values
        ]
        return summary_pairwise_indices
771562
def LookupClients(self, keywords):
    
    if isinstance(keywords, string_types):
      raise ValueError(
          "Keywords should be an iterable, not a string (got %s)." % keywords)

    start_time, filtered_keywords = self._AnalyzeKeywords(keywords)

    keyword_map = data_store.REL_DB.ListClientsForKeywords(
        list(map(self._NormalizeKeyword, filtered_keywords)),
        start_time=start_time)

    results = itervalues(keyword_map)
    relevant_set = set(next(results))

    for hits in results:
      relevant_set &= set(hits)

      if not relevant_set:
        return []

    return sorted(relevant_set)
647767
def get_stats_item(self, item):
        
        if isinstance(self.stats, dict):
            try:
                return self._json_dumps({item: self.stats[item]})
            except KeyError as e:
                logger.error("Cannot get item {} ({})".format(item, e))
                return None
        elif isinstance(self.stats, list):
            try:
                # Source:
                # http://stackoverflow.com/questions/4573875/python-get-index-of-dictionary-item-in-list
                # But https://github.com/nicolargo/glances/issues/1401
                return self._json_dumps({item: list(map(itemgetter(item), self.stats))})
            except (KeyError, ValueError) as e:
                logger.error("Cannot get item {} ({})".format(item, e))
                return None
        else:
            return None
1089346
def getFeatureByIndex(self, index):
        
        feature = self.layer[index]
        if feature is None:
            feature = self.getfeatures()[index]
        return feature
1083375
def get(self, **kwargs):
        
        results = self.search(**kwargs)
        # If there are multiple matches, prefer exact matches on api_version
        if len(results) > 1 and kwargs.get('api_version'):
            results = [
                result for result in results if result.group_version == kwargs['api_version']
            ]
        # If there are multiple matches, prefer non-List kinds
        if len(results) > 1 and not all([isinstance(x, ResourceList) for x in results]):
            results = [result for result in results if not isinstance(result, ResourceList)]
        if len(results) == 1:
            return results[0]
        elif not results:
            raise ResourceNotFoundError('No matches found for {}'.format(kwargs))
        else:
            raise ResourceNotUniqueError('Multiple matches found for {}: {}'.format(kwargs, results))
752302
def get_keyword_query(self, **kw):
        
        query = dict()

        # Only known indexes get observed
        indexes = self.catalog.get_indexes()

        # Handle additional keyword parameters
        for k, v in kw.iteritems():
            # handle uid in keywords
            if k.lower() == "uid":
                k = "UID"
            # handle portal_type in keywords
            if k.lower() == "portal_type":
                if v:
                    v = _.to_list(v)
            if k not in indexes:
                logger.warn("Skipping unknown keyword parameter '%s=%s'" % (k, v))
                continue
            if v is None:
                logger.warn("Skip None value in kw parameter '%s=%s'" % (k, v))
                continue
            logger.debug("Adding '%s=%s' to query" % (k, v))
            query[k] = v

        return query
298254
def index(cls):
        
        res = requests.get(cls.URL, headers=HEADERS, verify=False)
        res.raise_for_status()
        return res.json()
847891
def stats_per_key(self):
        
        self.raise_error_if_not_open()

        all_stats = {}

        for key, data in self._file.items():
            data = data[()]
            all_stats[key] = stats.DataStats(float(np.mean(data)),
                                             float(np.var(data)),
                                             np.min(data),
                                             np.max(data),
                                             data.size)

        return all_stats
257492
def get_mapping(self, using=None, **kwargs):
        
        return self._get_connection(using).indices.get_mapping(index=self._name, **kwargs)
1215155
def _parse_index_value(self, kwargs):
        
        if len(kwargs) == 0:
            return None, None
        elif len(kwargs) > 1:
            raise ValueError("You can't pass more than one value expression, "
                             "you passed {}".format(",".join(kwargs.keys())))

        name, value = list(kwargs.items())[0]

        if not name.startswith('value'):
            raise ValueError("The keyword arg {} is not valid for this "
                             "function".format(name))

        if name == 'value':
            return ('=', value)

        if not name.startswith('value__'):
            raise ValueError("The keyword arg {} is not valid for this "
                             "function".format(name))

        operator = name[name.find('__') + 2:]
        try:
            return (self._operator_values[operator], value)
        except KeyError:
            raise ValueError(
                "The operator {op} is not valid for index value matching. "
                "Valid operators are {valid}"
                .format(
                    op=operator,
                    valid=",".join(self._operator_values.keys()),
                ),
            )
551753
def sorted_stats(self):
        """"""
        key = self.get_key()
        return sorted(self.stats, key=lambda stat: tuple(map(
            lambda part: int(part) if part.isdigit() else part.lower(),
            re.split(r"(\d+|\D+)", self.has_alias(stat[key]) or stat[key])
        )))