# Path: muninn/_compat.py
# PY3 = sys.version_info[0] == 3
#     def is_python2_unicode(x):
#     def dictkeys(d):
#     def dictvalues(d):
#     def path_utf8(path):
#     def encode(s):
#     def decode(s):
#     def is_python2_unicode(x):
#     def path_utf8(path):
#     def decode(s):
#     def encode(s):
# 
# Path: muninn/visitor.py
# class TypeVisitor(object):
#     def visit(self, visitable, *args, **kwargs):
#         for type in inspect.getmro(visitable):
#             try:
#                 visit_func = getattr(self, "visit_%s" % type.__name__)
#             except AttributeError:
#                 pass
#             else:
#                 return visit_func(visitable, *args, **kwargs)
# 
#         try:
#             visit_func = getattr(self, "default")
#         except AttributeError:
#             pass
#         else:
#             return visit_func(visitable, *args, **kwargs)


from muninn._compat import string_types as basestring
from muninn.schema import *
from muninn.visitor import TypeVisitor

    def visit_Mapping(self, type, value, path):
        path = "%s:" % type.name() if not path else path

        try:
            iterator = iter(value)
        except TypeError:
            raise ValueError(prefix_message_with_path(path, "expected a mapping"))

        mapping = {}
        for sub_name in iterator:
            if not isinstance(sub_name, basestring):
                raise ValueError(prefix_message_with_path(path, "invalid item name: %r" % sub_name))

            try:
                sub_value = value[sub_name]
            except TypeError:
                raise ValueError(prefix_message_with_path(path, "expected a mapping"))

            try:
                sub_type = type[sub_name]
            except KeyError:
                raise ValueError(prefix_message_with_path(join(path, sub_name), "unrecognized configuration option"))

            mapping[sub_name] = super(_ConfigParser, self).visit(sub_type, sub_value, join(path, sub_name))
        return mapping

    def visit_Sequence(self, type, value, path):
        path = "%s:" % type.name() if not path else path


# Path: muninn/_compat.py
# PY3 = sys.version_info[0] == 3
#     def is_python2_unicode(x):
#     def dictkeys(d):
#     def dictvalues(d):
#     def path_utf8(path):
#     def encode(s):
#     def decode(s):
#     def is_python2_unicode(x):
#     def path_utf8(path):
#     def decode(s):
#     def encode(s):
# 
# Path: muninn/visitor.py
# class TypeVisitor(object):
#     def visit(self, visitable, *args, **kwargs):
#         for type in inspect.getmro(visitable):
#             try:
#                 visit_func = getattr(self, "visit_%s" % type.__name__)
#             except AttributeError:
#                 pass
#             else:
#                 return visit_func(visitable, *args, **kwargs)
# 
#         try:
#             visit_func = getattr(self, "default")
#         except AttributeError:
#             pass
#         else:
#             return visit_func(visitable, *args, **kwargs)


# Path: muninn/config.py
from muninn._compat import string_types as basestring
from muninn.schema import *
from muninn.visitor import TypeVisitor


    def visit_Mapping(self, type, value, path):
        path = "%s:" % type.name() if not path else path

        try:
            iterator = iter(value)
        except TypeError:
            raise ValueError(prefix_message_with_path(path, "expected a mapping"))

        mapping = {}
        for sub_name in iterator:
            if not isinstance(sub_name, basestring):
                raise ValueError(prefix_message_with_path(path, "invalid item name: %r" % sub_name))

            try:
                sub_value = value[sub_name]
            except TypeError:
                raise ValueError(prefix_message_with_path(path, "expected a mapping"))

            try:
                sub_type = type[sub_name]
            except KeyError:
                raise ValueError(prefix_message_with_path(join(path, sub_name), "unrecognized configuration option"))

            mapping[sub_name] = super(_ConfigParser, self).visit(sub_type, sub_value, join(path, sub_name))
        return mapping

    def visit_Sequence(self, type, value, path):
        path = "%s:" % type.name() if not path else path


        if not isinstance(value, basestring):