# Path: clonedigger/logilab/common/compat.py
# class set(_baseset):
#     """mutable set"""
#     def add(self, value):
#         self._data[value] = 1
# 
#     def remove(self, element):
#         """removes <element> from set"""
#         del self._data[element]
# 
#     def pop(self):
#         """pops an arbitrary element from set"""
#         return self._data.popitem()[0]
# 
#     def __hash__(self):
#         """mutable et cannot be hashed."""
#         raise TypeError("set objects are not hashable")
# 
# Path: clonedigger/logilab/common/optik_ext.py
#         NO_DEFAULT = []
#     HAS_MX_DATETIME = True
#     HAS_MX_DATETIME = False
# OPTPARSE_FORMAT_DEFAULT = sys.version_info >= (2, 4)
#     TYPES = BaseOption.TYPES + ('regexp', 'csv', 'yn', 'named', 'password',
#                                 'multiple_choice', 'file', 'font', 'color')
#     TYPE_CHECKER = copy(BaseOption.TYPE_CHECKER)
# def check_regexp(option, opt, value):
# def check_csv(option, opt, value):
# def check_yn(option, opt, value):
# def check_named(option, opt, value):
# def check_password(option, opt, value):
# def check_file(option, opt, value):
# def check_date(option, opt, value):
# def check_color(option, opt, value):
#     def _check_choice(self):
#     def process(self, opt, value, values, parser):
#     def __init__(self, option_class=Option, *args, **kwargs):
#     def __init__ (self,
#                   indent_increment=0,
#                   max_help_position=24,
#                   width=79,
#                   short_first=0):
#     def format_heading(self, heading):
#     def format_description(self, description):
#     def format_option(self, option):
#     def format_head(self, optparser, pkginfo, section=1):
#     def format_title(self, pgm, section):
#     def format_short_description(self, pgm, short_desc):
#     def format_synopsis(self, pgm):
#     def format_long_description(self, pgm, long_desc):
#     def format_tail(self, pkginfo):
# def generate_manpage(optparser, pkginfo, section=1, stream=sys.stdout):
# class Option(BaseOption):
# class OptionParser(BaseParser):
# class ManHelpFormatter(HelpFormatter):


from future import standard_library
from builtins import input
from builtins import str
from builtins import range
from builtins import *
from builtins import object
from os.path import exists
from copy import copy
from configparser import ConfigParser, NoOptionError, NoSectionError
from clonedigger.logilab.common.compat import set
from clonedigger.logilab.common.textutils import normalize_text, unquote
from clonedigger.logilab.common.optik_ext import OptionParser, OptionGroup, Values, \
     OptionValueError, OptionError, HelpFormatter, generate_manpage, check_date, \
     check_yn, check_csv, check_file, check_color, check_named, check_password,\
     NO_DEFAULT, OPTPARSE_FORMAT_DEFAULT
    from getpass import getpass
import os
import sys
import re
        try:
            expand_default_backup = HelpFormatter.expand_default
            HelpFormatter.expand_default = expand_default
        except AttributeError:
            # python < 2.4: nothing to be done
            pass
        try:
            if args is None:
                args = sys.argv[1:]
            else:
                args = list(args)
            (options, args) = self._optik_parser.parse_args(args=args)
            for provider in list(self._nocallback_options.keys()):
                config = provider.config
                for attr in list(config.__dict__.keys()):
                    value = getattr(options, attr, None)
                    if value is None:
                        continue
                    setattr(config, attr, value)
            return args
        finally:
            if hasattr(HelpFormatter, 'expand_default'):
                # unpatch optparse to avoid side effects
                HelpFormatter.expand_default = expand_default_backup


    # help methods ############################################################

    def add_help_section(self, title, description):
        """add a dummy option section for help purpose """

# Path: clonedigger/logilab/common/compat.py
# class set(_baseset):
#     """mutable set"""
#     def add(self, value):
#         self._data[value] = 1
# 
#     def remove(self, element):
#         """removes <element> from set"""
#         del self._data[element]
# 
#     def pop(self):
#         """pops an arbitrary element from set"""
#         return self._data.popitem()[0]
# 
#     def __hash__(self):
#         """mutable et cannot be hashed."""
#         raise TypeError("set objects are not hashable")
# 
# Path: clonedigger/logilab/common/optik_ext.py
#         NO_DEFAULT = []
#     HAS_MX_DATETIME = True
#     HAS_MX_DATETIME = False
# OPTPARSE_FORMAT_DEFAULT = sys.version_info >= (2, 4)
#     TYPES = BaseOption.TYPES + ('regexp', 'csv', 'yn', 'named', 'password',
#                                 'multiple_choice', 'file', 'font', 'color')
#     TYPE_CHECKER = copy(BaseOption.TYPE_CHECKER)
# def check_regexp(option, opt, value):
# def check_csv(option, opt, value):
# def check_yn(option, opt, value):
# def check_named(option, opt, value):
# def check_password(option, opt, value):
# def check_file(option, opt, value):
# def check_date(option, opt, value):
# def check_color(option, opt, value):
#     def _check_choice(self):
#     def process(self, opt, value, values, parser):
#     def __init__(self, option_class=Option, *args, **kwargs):
#     def __init__ (self,
#                   indent_increment=0,
#                   max_help_position=24,
#                   width=79,
#                   short_first=0):
#     def format_heading(self, heading):
#     def format_description(self, description):
#     def format_option(self, option):
#     def format_head(self, optparser, pkginfo, section=1):
#     def format_title(self, pgm, section):
#     def format_short_description(self, pgm, short_desc):
#     def format_synopsis(self, pgm):
#     def format_long_description(self, pgm, long_desc):
#     def format_tail(self, pkginfo):
# def generate_manpage(optparser, pkginfo, section=1, stream=sys.stdout):
# class Option(BaseOption):
# class OptionParser(BaseParser):
# class ManHelpFormatter(HelpFormatter):


# Path: clonedigger/logilab/common/configuration.py
from future import standard_library
from builtins import input
from builtins import str
from builtins import range
from builtins import *
from builtins import object
from os.path import exists
from copy import copy
from configparser import ConfigParser, NoOptionError, NoSectionError
from clonedigger.logilab.common.compat import set
from clonedigger.logilab.common.textutils import normalize_text, unquote
from clonedigger.logilab.common.optik_ext import OptionParser, OptionGroup, Values, \
     OptionValueError, OptionError, HelpFormatter, generate_manpage, check_date, \
     check_yn, check_csv, check_file, check_color, check_named, check_password,\
     NO_DEFAULT, OPTPARSE_FORMAT_DEFAULT
    from getpass import getpass
import os
import sys
import re

        try:
            expand_default_backup = HelpFormatter.expand_default
            HelpFormatter.expand_default = expand_default
        except AttributeError:
            # python < 2.4: nothing to be done
            pass
        try:
            if args is None:
                args = sys.argv[1:]
            else:
                args = list(args)
            (options, args) = self._optik_parser.parse_args(args=args)
            for provider in list(self._nocallback_options.keys()):
                config = provider.config
                for attr in list(config.__dict__.keys()):
                    value = getattr(options, attr, None)
                    if value is None:
                        continue
                    setattr(config, attr, value)
            return args
        finally:
            if hasattr(HelpFormatter, 'expand_default'):
                # unpatch optparse to avoid side effects
                HelpFormatter.expand_default = expand_default_backup


    # help methods ############################################################

    def add_help_section(self, title, description):
        """add a dummy option section for help purpose """

        group = OptionGroup(self._optik_parser,