def get_instance_stream(self, instream):
        for source in instream:
            try:
                is_doc = issubclass(source, schema.Document)
                is_instance = False
            except __HOLE__:
                is_doc = False
                is_instance = isinstance(source, schema.Document)
            
            if is_doc:
                queryset = source.objects.all().iterator()
            elif is_instance:
                queryset = [source]
            else:
                if hasattr(source, 'iterator'):
                    queryset = source.iterator()
                else:
                    queryset = source
            for item in queryset:
                yield item
dataset/ETHPy150Open zbyte64/django-dockit/dockit/datataps.py/DocumentDataTap.get_instance_stream