code: def new_stats_exporter(option):
      """new_stats_exporter returns an exporter
      that exports stats to Prometheus.
      """
      if option.namespace == "":
          raise ValueError("Namespace can not be empty string.")
  
      collector = new_collector(option)
  
      exporter = PrometheusStatsExporter(
          options=option, gatherer=option.registry, collector=collector
      )
      return exporter
  
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 1 for calling a global function with example usage: new_stats_exporter(option) and returns: exporter