# Path: schwa/dr/containers.py
# class StoreList(list):
#   __slots__ = ('_klass', )
# 
#   def __init__(self, klass, *args, **kwargs):
#     super(StoreList, self).__init__(*args, **kwargs)
#     self._klass = klass
# 
#   def __repr__(self):
#     r = super(StoreList, self).__repr__()
#     return 'StoreList({0})'.format(r)
# 
#   def clear(self):
#     del self[:]
# 
#   def create(self, **kwargs):
#     """Instantiate, append and return an object of this store's klass"""
#     obj = self._klass(**kwargs)
#     self.append(obj)
#     return obj
# 
#   def create_n(self, n, **kwargs):
#     """Instantiate and append n objects of this store's klass, returning the corresponding slice"""
#     for i in xrange(n):
#       obj = self._klass(**kwargs)
#       self.append(obj)
#     return slice(len(self) - n, len(self))
# 
# Path: schwa/dr/exceptions.py
# class DependencyException(Exception):
#   pass
# 
# Path: schwa/dr/fields_core.py
# class BaseField(BaseAttr):
#   def from_wire(self, val, rtfield, cur_store, doc):
#     """
#     Deserialization hook for converting msgpack values into Python values
#     specific to this field type.
#     @param val the value return from msgpack unpacking
#     @param rtfield the RTField instance for the current field
#     @param cur_store the Store instance that the value is from
#     @param doc the current Doc instance
#     """
#     raise NotImplementedError
# 
#   def should_write(self, val):
#     return val is not None
# 
#   def to_wire(self, obj, rtfield, cur_store, doc):
#     """
#     Serialization hook for converting Python values into msgpack values
#     specific to this field type.
#     @param val the value return from msgpack unpacking
#     @param rtfield the RTField instance for the current field
#     @param cur_store the Store instance that the value is from
#     @param doc the current Doc instance
#     """
#     raise NotImplementedError
# 
# class Store(BaseAttr):
#   """
#   A Store houses Annotation instances. For an Annotation to be serialised, it needs
#   to be placed into a Store.
#   """
#   __slots__ = ('_klass', '_klass_name')
# 
#   def __init__(self, klass, serial=None, help=None):
#     from .meta import Ann
#     super(Store, self).__init__(serial=serial, help=help)
#     if isinstance(klass, (six.binary_type, six.text_type)):
#       self._klass_name = klass
#       self._klass = None
#     elif issubclass(klass, Ann):
#       self._klass_name = None
#       self._klass = klass
#     else:
#       raise ValueError('Unknown first argument {0!r}.'.format(klass))
# 
#   def default(self):
#     if self._klass is None:
#       self.resolve_klasses()
#     assert self._klass is not None
#     return StoreList(self._klass)


import collections
import six
from .containers import StoreList
from .exceptions import DependencyException
from .fields_core import BaseField, Store
    from .schema import create_schema
  from .fields_core import Field
        break

    kwargs = ', '.join(kwargs)
    if len(kwargs) > max_arg_len:
      kwargs = kwargs[:max(0, max_arg_len - 3)] + '...'
    return '{}({})'.format(self.__class__.__name__, kwargs)


class Ann(Base):
  __slots__ = ('_dr_index', )

  def __init__(self, **kwargs):
    super(Ann, self).__init__(**kwargs)
    self._dr_index = None

  def __lt__(self, other):
    if self._dr_index is None:
      return -1
    else:
      return self._dr_index < other._dr_index


class Doc(Base):
  __slots__ = ('_dr_rt', '_dr_decorated_by', )

  def __init__(self, **kwargs):
    super(Doc, self).__init__(**kwargs)
    self._dr_rt = None

  def __setattr__(self, attr, value):

# Path: schwa/dr/containers.py
# class StoreList(list):
#   __slots__ = ('_klass', )
# 
#   def __init__(self, klass, *args, **kwargs):
#     super(StoreList, self).__init__(*args, **kwargs)
#     self._klass = klass
# 
#   def __repr__(self):
#     r = super(StoreList, self).__repr__()
#     return 'StoreList({0})'.format(r)
# 
#   def clear(self):
#     del self[:]
# 
#   def create(self, **kwargs):
#     """Instantiate, append and return an object of this store's klass"""
#     obj = self._klass(**kwargs)
#     self.append(obj)
#     return obj
# 
#   def create_n(self, n, **kwargs):
#     """Instantiate and append n objects of this store's klass, returning the corresponding slice"""
#     for i in xrange(n):
#       obj = self._klass(**kwargs)
#       self.append(obj)
#     return slice(len(self) - n, len(self))
# 
# Path: schwa/dr/exceptions.py
# class DependencyException(Exception):
#   pass
# 
# Path: schwa/dr/fields_core.py
# class BaseField(BaseAttr):
#   def from_wire(self, val, rtfield, cur_store, doc):
#     """
#     Deserialization hook for converting msgpack values into Python values
#     specific to this field type.
#     @param val the value return from msgpack unpacking
#     @param rtfield the RTField instance for the current field
#     @param cur_store the Store instance that the value is from
#     @param doc the current Doc instance
#     """
#     raise NotImplementedError
# 
#   def should_write(self, val):
#     return val is not None
# 
#   def to_wire(self, obj, rtfield, cur_store, doc):
#     """
#     Serialization hook for converting Python values into msgpack values
#     specific to this field type.
#     @param val the value return from msgpack unpacking
#     @param rtfield the RTField instance for the current field
#     @param cur_store the Store instance that the value is from
#     @param doc the current Doc instance
#     """
#     raise NotImplementedError
# 
# class Store(BaseAttr):
#   """
#   A Store houses Annotation instances. For an Annotation to be serialised, it needs
#   to be placed into a Store.
#   """
#   __slots__ = ('_klass', '_klass_name')
# 
#   def __init__(self, klass, serial=None, help=None):
#     from .meta import Ann
#     super(Store, self).__init__(serial=serial, help=help)
#     if isinstance(klass, (six.binary_type, six.text_type)):
#       self._klass_name = klass
#       self._klass = None
#     elif issubclass(klass, Ann):
#       self._klass_name = None
#       self._klass = klass
#     else:
#       raise ValueError('Unknown first argument {0!r}.'.format(klass))
# 
#   def default(self):
#     if self._klass is None:
#       self.resolve_klasses()
#     assert self._klass is not None
#     return StoreList(self._klass)


# Path: schwa/dr/meta.py
import collections
import six
from .containers import StoreList
from .exceptions import DependencyException
from .fields_core import BaseField, Store
    from .schema import create_schema
  from .fields_core import Field

        break

    kwargs = ', '.join(kwargs)
    if len(kwargs) > max_arg_len:
      kwargs = kwargs[:max(0, max_arg_len - 3)] + '...'
    return '{}({})'.format(self.__class__.__name__, kwargs)


class Ann(Base):
  __slots__ = ('_dr_index', )

  def __init__(self, **kwargs):
    super(Ann, self).__init__(**kwargs)
    self._dr_index = None

  def __lt__(self, other):
    if self._dr_index is None:
      return -1
    else:
      return self._dr_index < other._dr_index


class Doc(Base):
  __slots__ = ('_dr_rt', '_dr_decorated_by', )

  def __init__(self, **kwargs):
    super(Doc, self).__init__(**kwargs)
    self._dr_rt = None

  def __setattr__(self, attr, value):

    if attr in self._dr_stores and not isinstance(value, StoreList):