class_docstr: Collector represents the Prometheus Collector object
class_docstr_tok: ["Collector","represents","the","Prometheus","Collector","object"]
docstr: Collect fetches the statistics from OpenCensus
  and delivers them as Prometheus Metrics.
  Collect is invoked every time a prometheus.Gatherer is run
  for example when the HTTP endpoint is invoked by Prometheus.
docstr_tok: ["Collect","fetches","the","statistics","from","OpenCensus","and","delivers","them","as","Prometheus","Metrics",".","Collect","is","invoked","every","time","a","prometheus.Gatherer","is","run","for","example","when","the","HTTP","endpoint","is","invoked","by","Prometheus","."]
code: def collect(self):  # pragma: NO COVER
      """Collect fetches the statistics from OpenCensus
      and delivers them as Prometheus Metrics.
      Collect is invoked every time a prometheus.Gatherer is run
      for example when the HTTP endpoint is invoked by Prometheus.
      """
      # Make a shallow copy of self._view_name_to_data_map, to avoid seeing
      # concurrent modifications when iterating through the dictionary.
      metrics_map = {}
      for (
          v_name,
          view_data,
      ) in self._view_name_to_data_map.copy().items():
          if v_name not in self.registered_views:
              continue
          desc = self.registered_views[v_name]
          for tag_values in view_data.tag_value_aggregation_data_map:
              agg_data = view_data.tag_value_aggregation_data_map[
                  tag_values
              ]
              metric = self.to_metric(
                  desc, tag_values, agg_data, metrics_map
              )
  
      for metric in metrics_map.values():
          yield metric
  
imports: import re
  from prometheus_client import start_http_server
  from prometheus_client.core import REGISTRY, CounterMetricFamily, GaugeMetricFamily, HistogramMetricFamily, UnknownMetricFamily
  from opencensus.common.transports import sync
  from opencensus.stats import aggregation_data
  from opencensus.stats import base_exporter
  import logging
label_desc: Use image node_id 9 for calling the Collector obj's underlying member method code with example usage: obj.collect() without return types