# Path: blitzdb/document.py
# class DoesNotExist(BaseException):
# class MultipleDocumentsReturned(BaseException):
# class MetaDocument(type):
#         class DoesNotExist(DoesNotExist):
#         class MultipleDocumentsReturned(MultipleDocumentsReturned):
# class Document(object):
#     class Meta:
#     def __str__(self):
#     def __str__(self):
#     def __new__(meta, name, bases, dct):
#     def __init__(self, attributes=None, lazy=False, backend=None, autoload=True, db_loader = None):
#     def __getitem__(self,key):
#     def lazy(self):
#     def lazy(self,lazy):
#     def lazy_attributes(self):
#     def attributes(self):
#     def attributes(self,value):
#     def get(self,key,default = None):
#     def has_key(self,key):
#     def keys(self):
#     def clear(self):
#     def values(self):
#     def items(self):
#     def properties(self):
#     def properties(self,value):
#     def __contains__(self, key):
#     def __iter__(self):
#     def get_lazy_attribute(self,key):
#     def __getattr__(self, key,load_if_lazy = True):
#     def __setattr__(self, key, value):
#     def __delattr__(self, key):
#     def __delitem__(self, key):
#     def __copy__(self):
#     def __deepcopy__(self, memo):
#     def __hash__(self):
#     def __ne__(self, other):
#     def __nonzero__(self):
#     def __eq__(self, other):
#     def __unicode__(self):
#         def __str__(self):
#     def _represent(self, n=1):
#         def truncate_dict(d, n=n):
#     def initialize(self):
#     def autogenerate_pk(self):
#     def get_pk_name(cls):
#     def pk(self):
#     def embed(self):
#     def eager(self):
#     def pk(self, value):
#     def backend(self):
#     def backend(self,backend):
#     def save(self, backend=None):
#     def delete(self, backend=None):
#     def revert(self, backend=None, implicit=False):
#     def load_if_lazy(self, implicit=False):


import abc
import copy
import inspect
import logging
import six
from blitzdb.document import Document, document_classes
    *The `Meta` attribute*

    As with `blitzdb.document.Document`, the `Meta` attribute can be used to define certain class-wide
    settings and properties. Redefine it in your backend implementation to change the default values.

    """

    class Meta(object):
        pass

    __metaclass__ = abc.ABCMeta

    standard_encoders = [ComplexEncoder]
    query_encoders = [ComplexQueryEncoder]

    def __init__(self, autodiscover_classes=True, autoload_embedded=True, allow_documents_in_query=True):
        self.classes = {}
        self.deprecated_classes = {}
        self.collections = {}
        self._autoload_embedded = autoload_embedded
        self._allow_documents_in_query = allow_documents_in_query
        if autodiscover_classes:
            self.autodiscover_classes()

    def autodiscover_classes(self):
        """
        Registers all document classes that have been defined in the code so far. The discovery mechanism
        works by reading the value of `blitzdb.document.document_classes`, which is updated by the meta-class
        of the :py:class:`blitzdb.document.Document` class upon creation of a new subclass.
        """

# Path: blitzdb/document.py
# class DoesNotExist(BaseException):
# class MultipleDocumentsReturned(BaseException):
# class MetaDocument(type):
#         class DoesNotExist(DoesNotExist):
#         class MultipleDocumentsReturned(MultipleDocumentsReturned):
# class Document(object):
#     class Meta:
#     def __str__(self):
#     def __str__(self):
#     def __new__(meta, name, bases, dct):
#     def __init__(self, attributes=None, lazy=False, backend=None, autoload=True, db_loader = None):
#     def __getitem__(self,key):
#     def lazy(self):
#     def lazy(self,lazy):
#     def lazy_attributes(self):
#     def attributes(self):
#     def attributes(self,value):
#     def get(self,key,default = None):
#     def has_key(self,key):
#     def keys(self):
#     def clear(self):
#     def values(self):
#     def items(self):
#     def properties(self):
#     def properties(self,value):
#     def __contains__(self, key):
#     def __iter__(self):
#     def get_lazy_attribute(self,key):
#     def __getattr__(self, key,load_if_lazy = True):
#     def __setattr__(self, key, value):
#     def __delattr__(self, key):
#     def __delitem__(self, key):
#     def __copy__(self):
#     def __deepcopy__(self, memo):
#     def __hash__(self):
#     def __ne__(self, other):
#     def __nonzero__(self):
#     def __eq__(self, other):
#     def __unicode__(self):
#         def __str__(self):
#     def _represent(self, n=1):
#         def truncate_dict(d, n=n):
#     def initialize(self):
#     def autogenerate_pk(self):
#     def get_pk_name(cls):
#     def pk(self):
#     def embed(self):
#     def eager(self):
#     def pk(self, value):
#     def backend(self):
#     def backend(self,backend):
#     def save(self, backend=None):
#     def delete(self, backend=None):
#     def revert(self, backend=None, implicit=False):
#     def load_if_lazy(self, implicit=False):


# Path: blitzdb/backends/base.py
import abc
import copy
import inspect
import logging
import six
from blitzdb.document import Document, document_classes

    *The `Meta` attribute*

    As with `blitzdb.document.Document`, the `Meta` attribute can be used to define certain class-wide
    settings and properties. Redefine it in your backend implementation to change the default values.

    """

    class Meta(object):
        pass

    __metaclass__ = abc.ABCMeta

    standard_encoders = [ComplexEncoder]
    query_encoders = [ComplexQueryEncoder]

    def __init__(self, autodiscover_classes=True, autoload_embedded=True, allow_documents_in_query=True):
        self.classes = {}
        self.deprecated_classes = {}
        self.collections = {}
        self._autoload_embedded = autoload_embedded
        self._allow_documents_in_query = allow_documents_in_query
        if autodiscover_classes:
            self.autodiscover_classes()

    def autodiscover_classes(self):
        """
        Registers all document classes that have been defined in the code so far. The discovery mechanism
        works by reading the value of `blitzdb.document.document_classes`, which is updated by the meta-class
        of the :py:class:`blitzdb.document.Document` class upon creation of a new subclass.
        """

        for document_class in document_classes: