Returns the count of searched Contentful entries.
342200
public function searchContentfulEntriesCount(string $searchText, ?Client $client = null): int
    {
        $client = $client ?? $this->defaultClient;

        $query = new Query();
        $query->where('query', $searchText);

        return count($client->getEntries($query));
    }
71449
def count_of_certain_kind(kind):
        '''
        
        '''

        recs = TabWiki.select().where(TabWiki.kind == kind)

        return recs.count()
430164
def count_annotation_entries(self) -> int:
        """"""
        return self.session.query(NamespaceEntry).filter(NamespaceEntry.is_annotation).count()
1019851
def get_video_count(self, search_q=None):
        ''''''
        if search_q is not None:
            params = {'q': search_q}
        else:
            params = None

        url = "/counts/videos"
        result = self._make_request(self.CMS_Server, 'GET', url, params=params)
        return result['count']
493207
def search(self):
        """"""
        # Retrieve all Or filters pertinent to the special coverage query.
        should_filters = [
            es_filter.Terms(pk=self.query.get("included_ids", [])),
            es_filter.Terms(pk=self.query.get("pinned_ids", []))
        ]
        should_filters += self.get_group_filters()

        # Compile list of all Must filters.
        must_filters = [
            es_filter.Bool(should=should_filters),
            ~es_filter.Terms(pk=self.query.get("excluded_ids", []))
        ]

        return Content.search_objects.search().filter(es_filter.Bool(must=must_filters))
1290732
def google_nest_count(self, style):
        """"""
        nest_count = 0
        if 'margin-left' in style:
            nest_count = int(style['margin-left'][:-2]) / self.google_list_indent
        return nest_count
250990
def get_topic_count(self):
        
        total = 0
        if self.kind == content_kinds.TOPIC or self.kind == "Channel":
            total = 1
            for child in self.children:
                total += child.get_topic_count()
        return total
1078754
def count_of_current_url(current_url):
        '''
        
        '''
        res = TabLog.select().where(TabLog.current_url == current_url)
        return res.count()
713960
def count(self, **query_dict):
        """"""
        param_dict = query_dict.copy()
        param_dict['count'] = 0
        resp_dict = self._get_query(**param_dict)
        return resp_dict['response']['numFound']
619220
def CountFlowLogEntries(self, client_id, flow_id, cursor=None):
    """"""

    query = ("SELECT COUNT(*) "
             "FROM flow_log_entries "
             "FORCE INDEX (flow_log_entries_by_flow) "
             "WHERE client_id = %s AND flow_id = %s ")
    args = [db_utils.ClientIDToInt(client_id), db_utils.FlowIDToInt(flow_id)]

    cursor.execute(query, args)
    return cursor.fetchone()[0]
832080
def get_count(self, query=None):
        
        query = query or Query()
        return self.get_db().alerts.find(query.where).count()
822729
def CountHuntFlows(self,
                     hunt_id,
                     filter_condition=db.HuntFlowsCondition.UNSET,
                     cursor=None):
    """"""
    hunt_id_int = db_utils.HuntIDToInt(hunt_id)

    query = ("SELECT COUNT(*) FROM flows "
             "FORCE INDEX(flows_by_hunt) "
             "WHERE parent_hunt_id = %s AND parent_flow_id IS NULL "
             "{filter_condition}")

    filter_query, extra_args = self._HuntFlowCondition(filter_condition)
    args = [hunt_id_int] + extra_args
    query = query.format(filter_condition=filter_query)
    cursor.execute(query, args)
    return cursor.fetchone()[0]
875266
def count(self):
        
        self.request_params.update({'sysparm_count': True})
        response = self.session.get(self._get_stats_url(),
                                    params=self._get_formatted_query(fields=list(),
                                                                     limit=None,
                                                                     order_by=list(),
                                                                     offset=None))

        content = self._get_content(response)

        return int(content['stats']['count'])
969927
def get_recirc_content(self, published=True, count=3):
        
        query = self.get_query()

        # check if query has included_ids & if there are any ids in it,
        # in case the ids have been removed from the array
        if not query.get('included_ids'):
            qs = Content.search_objects.search()
            qs = qs.query(
                TagBoost(slugs=self.tags.values_list("slug", flat=True))
            ).filter(
                ~Ids(values=[self.id])
            ).sort(
                "_score"
            )
            return qs[:count]

        # NOTE: set included_ids to just be the first 3 ids,
        # otherwise search will return last 3 items
        query['included_ids'] = query['included_ids'][:count]
        search = custom_search_model(Content, query, published=published, field_map={
            "feature_type": "feature_type.slug",
            "tag": "tags.slug",
            "content-type": "_type"
        })
        return search
1211277
def search(self, keyword, count=30):
        
        kwargs = {}
        kwargs['search_value'] = keyword
        root = self.root_directory
        entries = root._load_entries(func=self._req_files_search,
                                     count=count, page=1, **kwargs)

        res = []
        for entry in entries:
            if 'pid' in entry:
                res.append(_instantiate_directory(self, entry))
            else:
                res.append(_instantiate_file(self, entry))
        return res
1195552
def get_entries_count(module_name, query, opts={})
    login! unless logged_in?
    options = {
      :deleted => 0
    }.merge! opts

    json = <<-EOF
      {
        "session": "#{@sugar_session_id}",
        "module_name": "#{module_name}",
        "query": "#{query}",
        "deleted": #{options[:deleted]}
      }
    EOF
    json.gsub!(/^\s{6}/,'')
    send!(:get_entries_count, json)
  end
993702
def count_entries(self, table=None):
        """"""
        if table is None: table = self.main_table
        self.own_cursor.execute('SELECT COUNT(1) FROM "%s";' % table)
        return int(self.own_cursor.fetchone()[0])