# Path: flatland/schema/base.py
# class _BaseElement(object):
# class Element(_BaseElement):
# class Slot(object):
#     def __init__(self, value=Unspecified, **kw):
#     def named(cls, name):
#     def using(cls, **overrides):
#     def validated_by(cls, *validators):
#     def including_validators(cls, *validators, **kw):
#     def validate_element(self, element, state, descending):
#     def from_flat(cls, pairs, **kw):
#     def from_defaults(cls, **kw):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def label(self, cls):
#     def _get_all_valid(self):
#     def _set_all_valid(self, value):
#     def root(self):
#     def parents(self):
#     def path(self):
#     def children(self):
#     def all_children(self):
#     def fq_name(self, sep=u'.'):
#     def find(self, path, single=False, strict=True):
#     def el(self, path, sep=u'.'):
#     def _index(self, name):
#     def _parse_element_path(self, path, sep):
#     def add_error(self, message):
#     def add_warning(self, message):
#     def flattened_name(self, sep=u'_'):
#     def flatten(self, sep=u'_', value=operator.attrgetter('u')):
#     def set(self, value):
#     def set_flat(self, pairs, sep=u'_'):
#     def _set_flat(self, pairs, sep):
#     def set_default(self):
#     def is_empty(self):
#     def validate(self, state=None, recurse=True):
#     def _validate(self, state, descending):
#     def default_value(self):
#     def x(self):
#     def xa(self):
#     def __hash__(self):
# def validate_element(element, state, validators):


from flatland.schema import base
    def _format(element):
        prefix = get_prefix(element)
        path = element.fq_name()
        if not prefix:
            root = element.root
            if root.name is None:
                prefix = u'form'
            else:
                prefix = u'forms.%s' % (root.name,)
        return u"%s.el(%s)" % (prefix, repr(path).decode('raw_unicode_escape'))

    def __getitem__(self, key):
        if isinstance(key, str):
            try:
                key = key.decode('ascii')
            except UnicodeError:
                raise KeyError(key)
        item = self.element._index(key)
        if isinstance(item, base.Element):
            return WrappedElement(item)
        else:
            return item

    def __getattr__(self, attribute):
        return getattr(self.element, attribute)

    def __unicode__(self):
        return self._format(self.element)

    def __iter__(self):

# Path: flatland/schema/base.py
# class _BaseElement(object):
# class Element(_BaseElement):
# class Slot(object):
#     def __init__(self, value=Unspecified, **kw):
#     def named(cls, name):
#     def using(cls, **overrides):
#     def validated_by(cls, *validators):
#     def including_validators(cls, *validators, **kw):
#     def validate_element(self, element, state, descending):
#     def from_flat(cls, pairs, **kw):
#     def from_defaults(cls, **kw):
#     def __eq__(self, other):
#     def __ne__(self, other):
#     def label(self, cls):
#     def _get_all_valid(self):
#     def _set_all_valid(self, value):
#     def root(self):
#     def parents(self):
#     def path(self):
#     def children(self):
#     def all_children(self):
#     def fq_name(self, sep=u'.'):
#     def find(self, path, single=False, strict=True):
#     def el(self, path, sep=u'.'):
#     def _index(self, name):
#     def _parse_element_path(self, path, sep):
#     def add_error(self, message):
#     def add_warning(self, message):
#     def flattened_name(self, sep=u'_'):
#     def flatten(self, sep=u'_', value=operator.attrgetter('u')):
#     def set(self, value):
#     def set_flat(self, pairs, sep=u'_'):
#     def _set_flat(self, pairs, sep):
#     def set_default(self):
#     def is_empty(self):
#     def validate(self, state=None, recurse=True):
#     def _validate(self, state, descending):
#     def default_value(self):
#     def x(self):
#     def xa(self):
#     def __hash__(self):
# def validate_element(element, state, validators):


# Path: flatland/out/genshi/elements.py
from flatland.schema import base

    def _format(element):
        prefix = get_prefix(element)
        path = element.fq_name()
        if not prefix:
            root = element.root
            if root.name is None:
                prefix = u'form'
            else:
                prefix = u'forms.%s' % (root.name,)
        return u"%s.el(%s)" % (prefix, repr(path).decode('raw_unicode_escape'))

    def __getitem__(self, key):
        if isinstance(key, str):
            try:
                key = key.decode('ascii')
            except UnicodeError:
                raise KeyError(key)
        item = self.element._index(key)
        if isinstance(item, base.Element):
            return WrappedElement(item)
        else:
            return item

    def __getattr__(self, attribute):
        return getattr(self.element, attribute)

    def __unicode__(self):
        return self._format(self.element)

    def __iter__(self):

        return (WrappedElement(child) if isinstance(child, base.Element)