# Path: did/utils.py
# COLOR_ON = 1
# COLOR_OFF = 0
# COLOR_AUTO = 2
# LOG_ERROR = logging.ERROR
# LOG_WARN = logging.WARN
# LOG_INFO = logging.INFO
# LOG_DEBUG = logging.DEBUG
# LOG_DETAILS = 7
# LOG_DATA = 4
# LOG_ALL = 1
# EMAIL_REGEXP = re.compile(r'(?:"?([^"]*)"?\s)?(?:<?(.+@[^>]+)>?)')
#     COLORS = {
#         LOG_ERROR: "red",
#         LOG_WARN: "yellow",
#         LOG_INFO: "blue",
#         LOG_DEBUG: "green",
#         LOG_DETAILS: "cyan",
#         LOG_DATA: "magenta",
#         }
#     MAPPING = {
#         0: LOG_WARN,
#         1: LOG_INFO,
#         2: LOG_DEBUG,
#         3: LOG_DETAILS,
#         4: LOG_DATA,
#         5: LOG_ALL,
#         }
#     LEVELS = "CRITICAL DEBUG ERROR FATAL INFO NOTSET WARN WARNING".split()
#     MODES = ["COLOR_OFF", "COLOR_ON", "COLOR_AUTO"]
# def _find_base(path):
# def _import(path, continue_on_error):
# def _load_components(
#         path, include=".*", exclude="test", continue_on_error=True):
# def load_components(*paths, **kwargs):
# def header(text):
# def shorted(text, width=79):
# def item(text, level=0, options=None):
# def pluralize(singular=None):
# def listed(items, singular=None, plural=None, max=None, quote=""):
# def split(values, separator=re.compile("[ ,]+")):
# def ascii(text):
# def info(message, newline=True):
#     def __init__(self, name='did'):
#         def format(self, record):
#     def _create_logger(name='did', level=None):
#     def set(self, level=None):
#     def get(self):
# def color(text, color=None, background=None, light=False, enabled=True):
#     def __new__(cls, *args, **kwargs):
#     def __init__(self, mode=None):
#     def set(self, mode=None):
#     def get(self):
#     def enabled(self):
# class Logging(object):
#     class ColoredFormatter(logging.Formatter):
# class Coloring(object):
# 
# Path: did/utils.py
# COLOR_ON = 1
# COLOR_OFF = 0
# COLOR_AUTO = 2
# LOG_ERROR = logging.ERROR
# LOG_WARN = logging.WARN
# LOG_INFO = logging.INFO
# LOG_DEBUG = logging.DEBUG
# LOG_DETAILS = 7
# LOG_DATA = 4
# LOG_ALL = 1
# EMAIL_REGEXP = re.compile(r'(?:"?([^"]*)"?\s)?(?:<?(.+@[^>]+)>?)')
#     COLORS = {
#         LOG_ERROR: "red",
#         LOG_WARN: "yellow",
#         LOG_INFO: "blue",
#         LOG_DEBUG: "green",
#         LOG_DETAILS: "cyan",
#         LOG_DATA: "magenta",
#         }
#     MAPPING = {
#         0: LOG_WARN,
#         1: LOG_INFO,
#         2: LOG_DEBUG,
#         3: LOG_DETAILS,
#         4: LOG_DATA,
#         5: LOG_ALL,
#         }
#     LEVELS = "CRITICAL DEBUG ERROR FATAL INFO NOTSET WARN WARNING".split()
#     MODES = ["COLOR_OFF", "COLOR_ON", "COLOR_AUTO"]
# def _find_base(path):
# def _import(path, continue_on_error):
# def _load_components(
#         path, include=".*", exclude="test", continue_on_error=True):
# def load_components(*paths, **kwargs):
# def header(text):
# def shorted(text, width=79):
# def item(text, level=0, options=None):
# def pluralize(singular=None):
# def listed(items, singular=None, plural=None, max=None, quote=""):
# def split(values, separator=re.compile("[ ,]+")):
# def ascii(text):
# def info(message, newline=True):
#     def __init__(self, name='did'):
#         def format(self, record):
#     def _create_logger(name='did', level=None):
#     def set(self, level=None):
#     def get(self):
# def color(text, color=None, background=None, light=False, enabled=True):
#     def __new__(cls, *args, **kwargs):
#     def __init__(self, mode=None):
#     def set(self, mode=None):
#     def get(self):
#     def enabled(self):
# class Logging(object):
#     class ColoredFormatter(logging.Formatter):
# class Coloring(object):


import xmlrpc.client
import did.base
from did import utils
from did.utils import log
            obj = statsgroup(option=section, parent=self, user=user)
            # Override default order if requested
            if 'order' in data:
                try:
                    obj.order = int(data['order'])
                except ValueError:
                    raise did.base.GeneralError(
                        f"Invalid order '{data['order']}' "
                        f"in the '{section}' section.")
            results.append(obj)
        return sorted(results, key=lambda x: x.order)

    def add_option(self, parser):
        """ Add options for each stats group. """
        for stat in self.stats:
            stat.add_option(parser)


# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Header & Footer
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

class EmptyStats(Stats):
    """ Custom stats group for header & footer """

    def __init__(self, option, name=None, parent=None, user=None):
        Stats.__init__(self, option, name, parent, user)

    def show(self):
        """ Name only for empty stats """

# Path: did/utils.py
# COLOR_ON = 1
# COLOR_OFF = 0
# COLOR_AUTO = 2
# LOG_ERROR = logging.ERROR
# LOG_WARN = logging.WARN
# LOG_INFO = logging.INFO
# LOG_DEBUG = logging.DEBUG
# LOG_DETAILS = 7
# LOG_DATA = 4
# LOG_ALL = 1
# EMAIL_REGEXP = re.compile(r'(?:"?([^"]*)"?\s)?(?:<?(.+@[^>]+)>?)')
#     COLORS = {
#         LOG_ERROR: "red",
#         LOG_WARN: "yellow",
#         LOG_INFO: "blue",
#         LOG_DEBUG: "green",
#         LOG_DETAILS: "cyan",
#         LOG_DATA: "magenta",
#         }
#     MAPPING = {
#         0: LOG_WARN,
#         1: LOG_INFO,
#         2: LOG_DEBUG,
#         3: LOG_DETAILS,
#         4: LOG_DATA,
#         5: LOG_ALL,
#         }
#     LEVELS = "CRITICAL DEBUG ERROR FATAL INFO NOTSET WARN WARNING".split()
#     MODES = ["COLOR_OFF", "COLOR_ON", "COLOR_AUTO"]
# def _find_base(path):
# def _import(path, continue_on_error):
# def _load_components(
#         path, include=".*", exclude="test", continue_on_error=True):
# def load_components(*paths, **kwargs):
# def header(text):
# def shorted(text, width=79):
# def item(text, level=0, options=None):
# def pluralize(singular=None):
# def listed(items, singular=None, plural=None, max=None, quote=""):
# def split(values, separator=re.compile("[ ,]+")):
# def ascii(text):
# def info(message, newline=True):
#     def __init__(self, name='did'):
#         def format(self, record):
#     def _create_logger(name='did', level=None):
#     def set(self, level=None):
#     def get(self):
# def color(text, color=None, background=None, light=False, enabled=True):
#     def __new__(cls, *args, **kwargs):
#     def __init__(self, mode=None):
#     def set(self, mode=None):
#     def get(self):
#     def enabled(self):
# class Logging(object):
#     class ColoredFormatter(logging.Formatter):
# class Coloring(object):
# 
# Path: did/utils.py
# COLOR_ON = 1
# COLOR_OFF = 0
# COLOR_AUTO = 2
# LOG_ERROR = logging.ERROR
# LOG_WARN = logging.WARN
# LOG_INFO = logging.INFO
# LOG_DEBUG = logging.DEBUG
# LOG_DETAILS = 7
# LOG_DATA = 4
# LOG_ALL = 1
# EMAIL_REGEXP = re.compile(r'(?:"?([^"]*)"?\s)?(?:<?(.+@[^>]+)>?)')
#     COLORS = {
#         LOG_ERROR: "red",
#         LOG_WARN: "yellow",
#         LOG_INFO: "blue",
#         LOG_DEBUG: "green",
#         LOG_DETAILS: "cyan",
#         LOG_DATA: "magenta",
#         }
#     MAPPING = {
#         0: LOG_WARN,
#         1: LOG_INFO,
#         2: LOG_DEBUG,
#         3: LOG_DETAILS,
#         4: LOG_DATA,
#         5: LOG_ALL,
#         }
#     LEVELS = "CRITICAL DEBUG ERROR FATAL INFO NOTSET WARN WARNING".split()
#     MODES = ["COLOR_OFF", "COLOR_ON", "COLOR_AUTO"]
# def _find_base(path):
# def _import(path, continue_on_error):
# def _load_components(
#         path, include=".*", exclude="test", continue_on_error=True):
# def load_components(*paths, **kwargs):
# def header(text):
# def shorted(text, width=79):
# def item(text, level=0, options=None):
# def pluralize(singular=None):
# def listed(items, singular=None, plural=None, max=None, quote=""):
# def split(values, separator=re.compile("[ ,]+")):
# def ascii(text):
# def info(message, newline=True):
#     def __init__(self, name='did'):
#         def format(self, record):
#     def _create_logger(name='did', level=None):
#     def set(self, level=None):
#     def get(self):
# def color(text, color=None, background=None, light=False, enabled=True):
#     def __new__(cls, *args, **kwargs):
#     def __init__(self, mode=None):
#     def set(self, mode=None):
#     def get(self):
#     def enabled(self):
# class Logging(object):
#     class ColoredFormatter(logging.Formatter):
# class Coloring(object):


# Path: did/stats.py
import xmlrpc.client
import did.base
from did import utils
from did.utils import log

            obj = statsgroup(option=section, parent=self, user=user)
            # Override default order if requested
            if 'order' in data:
                try:
                    obj.order = int(data['order'])
                except ValueError:
                    raise did.base.GeneralError(
                        f"Invalid order '{data['order']}' "
                        f"in the '{section}' section.")
            results.append(obj)
        return sorted(results, key=lambda x: x.order)

    def add_option(self, parser):
        """ Add options for each stats group. """
        for stat in self.stats:
            stat.add_option(parser)


# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#  Header & Footer
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

class EmptyStats(Stats):
    """ Custom stats group for header & footer """

    def __init__(self, option, name=None, parent=None, user=None):
        Stats.__init__(self, option, name, parent, user)

    def show(self):
        """ Name only for empty stats """

        utils.item(self.name, options=self.options)