# Path: biggraphite/cli/command.py
# class BaseCommand(object):
# class ParseDateTimeArg(argparse.Action):
#     NAME = ""
#     HELP = ""
#     def add_arguments(self, parser):
#     def run(self, accessor, opts):
#     def __call__(self, parser, namespace, datetime_str, option_string=None):
# def date_time_from_str(datetime_str):
# def add_sharding_arguments(parser):
# def add_clean_arguments(parser):


import collections
import datetime
import re
import random
import time
import socket
import logging
import tabulate
from os import environ
from six.moves.configparser import ConfigParser
from biggraphite.cli import command
from prometheus_client import write_to_textfile, CollectorRegistry, Gauge
    pattern = carbon\.aggregator\.*

    [prometheus]
    pattern = prometheus\.*
    ```
    """

    def __init__(self, filename=None):
        """Initializer."""
        self.config = ConfigParser({}, collections.OrderedDict)
        self.patterns = collections.OrderedDict()

        if not filename:
            self.patterns[re.compile(".*")] = "total"
            self.config.add_section("total")
            return

        self.config.read(filename)
        for section in self.config.sections():
            pattern = re.compile(self.config.get(section, "pattern"))
            self.patterns[pattern] = section

    def lookup(self, metric_name):
        """Return the namespace corresponding to the metric."""
        for pattern, section in self.patterns.items():
            if pattern.match(metric_name):
                return section, self.config.items(section)
        return "none", None



# Path: biggraphite/cli/command.py
# class BaseCommand(object):
# class ParseDateTimeArg(argparse.Action):
#     NAME = ""
#     HELP = ""
#     def add_arguments(self, parser):
#     def run(self, accessor, opts):
#     def __call__(self, parser, namespace, datetime_str, option_string=None):
# def date_time_from_str(datetime_str):
# def add_sharding_arguments(parser):
# def add_clean_arguments(parser):


# Path: biggraphite/cli/command_stats.py
import collections
import datetime
import re
import random
import time
import socket
import logging
import tabulate
from os import environ
from six.moves.configparser import ConfigParser
from biggraphite.cli import command
from prometheus_client import write_to_textfile, CollectorRegistry, Gauge

    pattern = carbon\.aggregator\.*

    [prometheus]
    pattern = prometheus\.*
    ```
    """

    def __init__(self, filename=None):
        """Initializer."""
        self.config = ConfigParser({}, collections.OrderedDict)
        self.patterns = collections.OrderedDict()

        if not filename:
            self.patterns[re.compile(".*")] = "total"
            self.config.add_section("total")
            return

        self.config.read(filename)
        for section in self.config.sections():
            pattern = re.compile(self.config.get(section, "pattern"))
            self.patterns[pattern] = section

    def lookup(self, metric_name):
        """Return the namespace corresponding to the metric."""
        for pattern, section in self.patterns.items():
            if pattern.match(metric_name):
                return section, self.config.items(section)
        return "none", None



class CommandStats(command.BaseCommand):