Return a Counter of event-names that were broadcast.

        The Count will contain the key True if any of the broadcast blocks
        contain a parameter that is a variable.
490236
def get_broadcast_events(cls, script):
        
        events = Counter()
        for name, _, block in cls.iter_blocks(script):
            if 'broadcast %s' in name:
                if isinstance(block.args[0], kurt.Block):
                    events[True] += 1
                else:
                    events[block.args[0].lower()] += 1
        return events
236578
def top_broadcasts(count = 10)
      top_broadcasts = []
      request('getTopBroadcastsCombined').each do |key, _val|
        broadcast_id = key.split(':')[1]
        top_broadcasts.push(Broadcast.new(self, broadcast_id))
        count -= 1
        break if count == 0
      end

      top_broadcasts
    end
967273
def get_num_names( self, include_expired=False ):
        
        cur = self.db.cursor()
        return namedb_get_num_names( cur, self.lastblock, include_expired=include_expired )
1039230
def get_string_counter(fc, feature_name):
    '''

    '''
    if feature_name not in fc:
        feature = fc.get(FC.DISPLAY_PREFIX + feature_name)
    else:
        feature = fc.get(feature_name)
    if isinstance(feature, StringCounter):
        return feature
    else:
        return None
880608
def _PrintEventLabelsCounter(
      self, event_labels_counter, session_identifier=None):
    
    if not event_labels_counter:
      return

    title = 'Event tags generated per label'
    if session_identifier:
      title = '{0:s}: {1:s}'.format(title, session_identifier)

    table_view = views.ViewsFactory.GetTableView(
        self._views_format_type,
        column_names=['Label', 'Number of event tags'], title=title)

    for key, value in sorted(event_labels_counter.items()):
      if key == 'total':
        continue
      table_view.AddRow([key, value])

    try:
      total = event_labels_counter['total']
    except KeyError:
      total = 'N/A'

    table_view.AddRow(['Total', total])

    table_view.Write(self._output_writer)
404909
def get_block_count(self, is_full: bool = False) -> int or dict:
        
        payload = self.generate_json_rpc_payload(RpcMethod.GET_BLOCK_COUNT)
        response = self.__post(self.__url, payload)
        if is_full:
            return response
        return response['result']
103168
def count(self):
        ""
        if getattr(self, '_count', None) is None:
            self._count = getattr(self.node, 'count', 0)
        return self._count
1309911
def get_nonrentrant_counter(self, key):
        
        prefix = NONRENTRANT_STORAGE_OFFSET

        if key in self._nonrentrant_keys:
            return self._nonrentrant_keys[key]
        else:
            counter = prefix + self._nonrentrant_counter
            self._nonrentrant_keys[key] = counter
            self._nonrentrant_counter += 1
            return counter
272561
def _did_count(self, connection):
        

        self.current_connection = connection
        response = connection.response
        count = 0
        callback = None

        if 'X-Nuage-Count' in response.headers:
            count = int(response.headers['X-Nuage-Count'])

        if 'remote' in connection.callbacks:
            callback = connection.callbacks['remote']

        if connection.async:
            if callback:
                callback(self, self.parent_object, count)

                self.current_connection.reset()
                self.current_connection = None
        else:

            if connection.response.status_code >= 400 and BambouConfig._should_raise_bambou_http_error:
                raise BambouHTTPError(connection=connection)

            return (self, self.parent_object, count)
1365748
def counter(items):
    
    results = {}
    for item in items:
        results[item] = results.get(item, 0) + 1
    return results
987477
def _count(self, method, limit, keywords):
        
        # The limit will be mutated, so copy it and leave the original intact
        limit = limit.copy()
        has_more = True
        count = None
        while has_more:
            limit.set_request_args(keywords)
            response = self.call(method, **keywords)
            limit.post_fetch(response)
            count += Count.from_response(response)
            last_evaluated_key = response.get('LastEvaluatedKey')
            has_more = last_evaluated_key is not None and not limit.complete
            if has_more:
                keywords['ExclusiveStartKey'] = last_evaluated_key
        return count
1188706
def count(self):
        '''
        
        '''
        args = self.format_args
        if args is None or \
                (isinstance(args, dict) and self.count_field not in args):
            raise TypeError("count is required")
        return args[self.count_field] if isinstance(args, dict) else args
460190
def service_count(self, block_identifier: BlockSpecification) -> int:
        """"""
        result = self.proxy.contract.functions.serviceCount().call(
            block_identifier=block_identifier,
        )
        return result
1065271
def broadcast_equals(self, other, equiv=duck_array_ops.array_equiv):
        
        try:
            self, other = broadcast_variables(self, other)
        except (ValueError, AttributeError):
            return False
        return self.equals(other, equiv=equiv)
672384
def count_by_key_impl(sequence):
    
    counter = collections.Counter()
    for key, _ in sequence:
        counter[key] += 1
    return six.viewitems(counter)
1293695
public int getEventCount()
    {
        int count = _events.size();
        if (_superEventSet != null)
            count += _superEventSet.getEventCount();
        return count;
    }
1142201
def watching(w, watch, max_count=None, clear=True):
    

    if w and not watch:
        watch = 2
    if watch and clear:
        click.clear()
    yield 0

    if max_count is not None and max_count < 1:
        return

    counter = 1
    while watch and counter <= (max_count or counter):
        time.sleep(watch)
        counter += 1
        if clear:
            click.clear()
        yield 0