# Path: configmanager/base.py
# class BaseItem(object):
#     is_item = True
#     is_section = False
#     is_config = False
# 
# class BaseSection(object):
#     """
#     A base class to allow detection of section classes and instances.
#     No other functionality to be added here.
#     """
# 
#     is_item = False
#     is_section = True
#     is_config = False


import collections.abc
import inspect
import six
from .base import BaseItem, BaseSection
        return parse_config_schema([x for x in schema.items()], parent_section=parent_section, root=root)

    if isinstance(schema, collections.abc.Sequence) and not isinstance(schema, six.string_types):

        if len(schema) == 0 or not isinstance(schema[0], tuple):
            # Declaration of an item
            return parent_section.create_item(default=schema)

        # Pre-process all keys and discard private parts and separate out meta parts
        clean_schema = []
        meta = {}

        for k, v in schema:
            if k.startswith('_'):
                continue
            elif k.startswith('@'):
                meta[k[1:]] = v
                continue
            clean_schema.append((k, v))

        if not clean_schema or meta.get('type'):
            # Must be an item
            if not clean_schema:
                return parent_section.create_item(**meta)
            else:
                meta['default'] = dict(clean_schema)
                return parent_section.create_item(**meta)

        # If root is specified it means we are parsing schema for the root,
        # so no need to create a new section.

# Path: configmanager/base.py
# class BaseItem(object):
#     is_item = True
#     is_section = False
#     is_config = False
# 
# class BaseSection(object):
#     """
#     A base class to allow detection of section classes and instances.
#     No other functionality to be added here.
#     """
# 
#     is_item = False
#     is_section = True
#     is_config = False


# Path: configmanager/schema_parser.py
import collections.abc
import inspect
import six
from .base import BaseItem, BaseSection

        return parse_config_schema([x for x in schema.items()], parent_section=parent_section, root=root)

    if isinstance(schema, collections.abc.Sequence) and not isinstance(schema, six.string_types):

        if len(schema) == 0 or not isinstance(schema[0], tuple):
            # Declaration of an item
            return parent_section.create_item(default=schema)

        # Pre-process all keys and discard private parts and separate out meta parts
        clean_schema = []
        meta = {}

        for k, v in schema:
            if k.startswith('_'):
                continue
            elif k.startswith('@'):
                meta[k[1:]] = v
                continue
            clean_schema.append((k, v))

        if not clean_schema or meta.get('type'):
            # Must be an item
            if not clean_schema:
                return parent_section.create_item(**meta)
            else:
                meta['default'] = dict(clean_schema)
                return parent_section.create_item(**meta)

        # If root is specified it means we are parsing schema for the root,
        # so no need to create a new section.

        section = root or parent_section.create_section()