docstr: Go through an iterator of documents in batches, yield processed documents
  
  sentence indices will be counted across the entire iterator
code: def stream(self, docs, batch_size=50, *args, **kwargs):
      """
      Go through an iterator of documents in batches, yield processed documents
  
      sentence indices will be counted across the entire iterator
      """
      if not isinstance(docs, collections.abc.Iterator):
          docs = iter(docs)
  
      def next_batch():
          batch = []
          for _ in range(batch_size):
              try:
                  next_doc = next(docs)
                  batch.append(next_doc)
              except StopIteration:
                  return batch
          return batch
  
      sentence_start_index = 0
      batch = next_batch()
      while batch:
          batch = self.bulk_process(batch, *args, **kwargs)
          for doc in batch:
              doc.reindex_sentences(sentence_start_index)
              sentence_start_index += len(doc.sentences)
              yield doc
          batch = next_batch()
  
imports: import argparse
  import collections
  from enum import Enum
  import io
  import itertools
  import sys
  import logging
  import json
  import os
  from stanza.pipeline._constants import *
  from stanza.models.common.constant import langcode_to_lang
  from stanza.models.common.doc import Document
  from stanza.models.common.foundation_cache import FoundationCache
  from stanza.models.common.utils import default_device
  from stanza.pipeline.processor import Processor, ProcessorRequirementsException
  from stanza.pipeline.registry import NAME_TO_PROCESSOR_CLASS, PIPELINE_NAMES, PROCESSOR_VARIANTS
  from stanza.pipeline.langid_processor import LangIDProcessor
  from stanza.pipeline.tokenize_processor import TokenizeProcessor
  from stanza.pipeline.mwt_processor import MWTProcessor
  from stanza.pipeline.pos_processor import POSProcessor
  from stanza.pipeline.lemma_processor import LemmaProcessor
  from stanza.pipeline.constituency_processor import ConstituencyProcessor
  from stanza.pipeline.coref_processor import CorefProcessor
  from stanza.pipeline.depparse_processor import DepparseProcessor
  from stanza.pipeline.sentiment_processor import SentimentProcessor
  from stanza.pipeline.ner_processor import NERProcessor
  from stanza.resources.common import DEFAULT_MODEL_DIR, DEFAULT_RESOURCES_URL, DEFAULT_RESOURCES_VERSION, ModelSpecification, add_dependencies, add_mwt, download_models, download_resources_json, flatten_processor_list, load_resources_json, maintain_processor_list, process_pipeline_parameters, set_logging_level, sort_processors
  from stanza.resources.default_packages import PACKAGES
  from stanza.utils.helper_func import make_table
label_desc: Use image node_id 7 for calling the Pipeline obj's underlying member method code with example usage: obj.stream(docs, batch_size) and returns: batch, batch