# 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 codecs
import configparser
import datetime
import io
import os
import re
import sys
from configparser import NoOptionError, NoSectionError
from datetime import timedelta
from dateutil.relativedelta import FR as FRIDAY
from dateutil.relativedelta import MO as MONDAY
from dateutil.relativedelta import relativedelta as delta
from did import utils
from did.utils import log
    individual stats. This is useful if you use different email/login
    for different services. The syntax consists of ``stats: login`` or
    ``stats: email`` pairs appended at the end of the email address::

        some@email.org; bz: bugzilla@email.org; gh: githublogin

    Use config section name to identify stats where given alias should
    be used. The exactly same syntax can be used both in the config file
    and on the command line. Finally it's also possible to include the
    alias directly in the respective config section::

        [github]
        type = github
        url = https://api.github.com/
        login = psss
    """

    def __init__(self, email, stats=None):
        """ Detect name, login and email """
        # Make sure we received the email string, save the original for cloning
        if not email:
            raise ConfigError("Email required for user initialization.")
        self._original = email.strip()
        # Separate aliases if provided
        try:
            email, aliases = re.split(r"\s*;\s*", self._original, 1)
        except ValueError:
            email = self._original
            aliases = None
        # Extract everything from the email string provided

# 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/base.py
import codecs
import configparser
import datetime
import io
import os
import re
import sys
from configparser import NoOptionError, NoSectionError
from datetime import timedelta
from dateutil.relativedelta import FR as FRIDAY
from dateutil.relativedelta import MO as MONDAY
from dateutil.relativedelta import relativedelta as delta
from did import utils
from did.utils import log

    individual stats. This is useful if you use different email/login
    for different services. The syntax consists of ``stats: login`` or
    ``stats: email`` pairs appended at the end of the email address::

        some@email.org; bz: bugzilla@email.org; gh: githublogin

    Use config section name to identify stats where given alias should
    be used. The exactly same syntax can be used both in the config file
    and on the command line. Finally it's also possible to include the
    alias directly in the respective config section::

        [github]
        type = github
        url = https://api.github.com/
        login = psss
    """

    def __init__(self, email, stats=None):
        """ Detect name, login and email """
        # Make sure we received the email string, save the original for cloning
        if not email:
            raise ConfigError("Email required for user initialization.")
        self._original = email.strip()
        # Separate aliases if provided
        try:
            email, aliases = re.split(r"\s*;\s*", self._original, 1)
        except ValueError:
            email = self._original
            aliases = None
        # Extract everything from the email string provided

        parts = utils.EMAIL_REGEXP.search(email)