def to_python(self, value):
        if isinstance(value, basestring):
            return value

        if hasattr(value, 'to_python'):
            return value.to_python()

        is_list = False
        if not hasattr(value, 'items'):
            try:
                is_list = True
                value = dict([(k, v) for k, v in enumerate(value)])
            except TypeError:  # Not iterable return the value
                return value

        if self.field:
            self.field._auto_dereference = self._auto_dereference
            value_dict = dict([(key, self.field.to_python(item))
                               for key, item in value.items()])
        else:
            Document = _import_class('Document')
            value_dict = {}
            for k, v in value.items():
                if isinstance(v, Document):
                    # We need the id from the saved object to create the DBRef
                    if v.pk is None:
                        self.error('You can only reference documents once they'
                                   ' have been saved to the database')
                    collection = v._get_collection_name()
                    value_dict[k] = DBRef(collection, v.pk)
                elif hasattr(v, 'to_python'):
                    value_dict[k] = v.to_python()
                else:
                    value_dict[k] = self.to_python(v)

        if is_list:  # Convert back to a list
            return [v for _, v in sorted(value_dict.items(),
                                         key=operator.itemgetter(0))]
        return value_dict
The C{exportTo} VCS command's method export the content of the
dataset/ETHPy150Open MongoEngine/mongoengine/mongoengine/base/fields.py/ComplexBaseField.to_python--crossover with--dataset/ETHPy150Open twisted/twisted/twisted/python/test/test_release.py/CommandsTestMixin.test_export