docstr: Run the pipeline
  
  processors: allow for a list of processors used by this pipeline action
    can be list, tuple, set, or comma separated string
    if None, use all the processors this pipeline knows about
    MWT is added if necessary
    otherwise, no care is taken to make sure prerequisites are followed...
      some of the annotators, such as depparse, will check, but others
      will fail in some unusual manner or just have really bad results
code: def process(self, doc, processors=None):
      """
      Run the pipeline
  
      processors: allow for a list of processors used by this pipeline action
        can be list, tuple, set, or comma separated string
        if None, use all the processors this pipeline knows about
        MWT is added if necessary
        otherwise, no care is taken to make sure prerequisites are followed...
          some of the annotators, such as depparse, will check, but others
          will fail in some unusual manner or just have really bad results
      """
      assert any(
          [
              isinstance(doc, str),
              isinstance(doc, list),
              isinstance(doc, Document),
          ]
      ), "input should be either str, list or Document"
  
      # empty bulk process
      if isinstance(doc, list) and len(doc) == 0:
          return []
  
      # determine whether we are in bulk processing mode for multiple documents
      bulk = (
          isinstance(doc, list)
          and len(doc) > 0
          and isinstance(doc[0], Document)
      )
  
      # various options to limit the processors used by this pipeline action
      if processors is None:
          processors = PIPELINE_NAMES
      elif not isinstance(processors, (str, list, tuple, set)):
          raise ValueError(
              "Cannot process {} as a list of processors to run".format(
                  type(processors)
              )
          )
      else:
          if isinstance(processors, str):
              processors = {x for x in processors.split(",")}
          else:
              processors = set(processors)
          if (
              TOKENIZE in processors
              and MWT in self.processors
              and MWT not in processors
          ):
              logger.debug(
                  "Requested processors for pipeline did not have mwt, but pipeline needs mwt, so mwt is added"
              )
              processors.add(MWT)
          processors = [x for x in PIPELINE_NAMES if x in processors]
  
      for processor_name in processors:
          if self.processors.get(processor_name):
              process = (
                  self.processors[processor_name].bulk_process
                  if bulk
                  else self.processors[processor_name].process
              )
              doc = process(doc)
      return doc
  
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 5 for calling the Pipeline obj's underlying member method code with example usage: obj.process(doc, processors) and returns: doc, list