# 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
    def generate_config(self, stream=None, skipsections=()):
        """write a configuration file according to the current configuration
        into the given stream or stdout
        """
        stream = stream or sys.stdout
        printed = False
        for provider in self.options_providers:
            default_options = []
            sections = {}
            for section, options in provider.options_by_section():
                if section in skipsections:
                    continue
                options = [(n, d, v) for (n, d, v) in options
                           if d.get('type') is not None]
                if not options:
                    continue
                if section is None:
                    section = provider.name
                    doc = provider.__doc__
                else:
                    doc = None
                if printed:
                    print('\n', file=stream)
                format_section(stream, section.upper(), options, doc)
                printed = True

    def generate_manpage(self, pkginfo, section=1, stream=None):
        """write a man page for the current configuration into the given
        stream or stdout
        """

# 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

    def generate_config(self, stream=None, skipsections=()):
        """write a configuration file according to the current configuration
        into the given stream or stdout
        """
        stream = stream or sys.stdout
        printed = False
        for provider in self.options_providers:
            default_options = []
            sections = {}
            for section, options in provider.options_by_section():
                if section in skipsections:
                    continue
                options = [(n, d, v) for (n, d, v) in options
                           if d.get('type') is not None]
                if not options:
                    continue
                if section is None:
                    section = provider.name
                    doc = provider.__doc__
                else:
                    doc = None
                if printed:
                    print('\n', file=stream)
                format_section(stream, section.upper(), options, doc)
                printed = True

    def generate_manpage(self, pkginfo, section=1, stream=None):
        """write a man page for the current configuration into the given
        stream or stdout
        """

        generate_manpage(self._optik_parser, pkginfo,