'Cheaply dereferences the items to a set depth.
Also handles the conversion of complex data types.
:param items: The iterable (dict, list, queryset) to be dereferenced.
:param max_depth: The maximum depth to recurse to
:param instance: The owning instance used for tracking changes by
:class:`~mongoengine.base.ComplexBaseField`
:param name: The name of the field, used for tracking changes by
:class:`~mongoengine.base.ComplexBaseField`
:param get: A boolean determining if being called by __get__'

def __call__(self, items, max_depth=1, instance=None, name=None):

    if ((items is None) or isinstance(items, six.string_types)):
        return items
    if isinstance(items, QuerySet):
        items = [i for i in items]
    self.max_depth = max_depth
    doc_type = None
    if (instance and isinstance(instance, (Document, EmbeddedDocument, TopLevelDocumentMetaclass))):
        doc_type = instance._fields.get(name)
        while hasattr(doc_type, 'field'):
            doc_type = doc_type.field
        if isinstance(doc_type, ReferenceField):
            field = doc_type
            doc_type = doc_type.document_type
            is_list = (not hasattr(items, 'items'))
            if (is_list and all([(i.__class__ == doc_type) for i in items])):
                return items
            elif ((not is_list) and all([(i.__class__ == doc_type) for i in items.values()])):
                return items
            elif (not field.dbref):
                if (not hasattr(items, 'items')):
                    def _get_items(items):
                        new_items = []
                        for v in items:
                            if isinstance(v, list):
                                new_items.append(_get_items(v))
                            elif (not isinstance(v, (DBRef, Document))):
                                new_items.append(field.to_python(v))
                            else:
                                new_items.append(v)
                        return new_items
                    items = _get_items(items)
                else:
                    items = {k: (v if isinstance(v, (DBRef, Document)) else field.to_python(v)) for (k, v) in items.iteritems()}
    self.reference_map = self._find_references(items)
    self.object_map = self._fetch_objects(doc_type=doc_type)
    return self._attach_objects(items, 0, instance, name)
