code: def process_pipeline_parameters(lang, model_dir, package, processors):
      # Check parameter types and convert values to lower case
      if isinstance(lang, str):
          lang = lang.strip().lower()
      elif lang is not None:
          raise TypeError(
              f"The parameter 'lang' should be str, "
              f"but got {type(lang).__name__} instead."
          )
  
      if isinstance(model_dir, str):
          model_dir = model_dir.strip()
      elif model_dir is not None:
          raise TypeError(
              f"The parameter 'model_dir' should be str, "
              f"but got {type(model_dir).__name__} instead."
          )
  
      if isinstance(processors, (str, list, tuple)):
          # Special case: processors is str, compatible with older version
          # also allow for setting alternate packages for these processors
          # via the package argument
          if package is None:
              # each processor will be 'default' for this language
              package = defaultdict(lambda: "default")
          elif isinstance(package, str):
              # same, but now the named package will be the default instead
              default = package
              package = defaultdict(lambda: default)
          elif isinstance(package, dict):
              # the dictionary of packages will be used to build the processors dict
              # any processor not specified in package will be 'default'
              package = defaultdict(lambda: "default", package)
          else:
              raise TypeError(
                  f"The parameter 'package' should be None, str, or dict, "
                  f"but got {type(package).__name__} instead."
              )
          if isinstance(processors, str):
              processors = [
                  x.strip().lower() for x in processors.split(",")
              ]
          processors = {
              processor: package[processor] for processor in processors
          }
          package = None
      elif isinstance(processors, dict):
          processors = {
              k.strip().lower(): (
                  [v_i.strip().lower() for v_i in v]
                  if isinstance(v, (tuple, list))
                  else v.strip().lower()
              )
              for k, v in processors.items()
          }
      elif processors is not None:
          raise TypeError(
              f"The parameter 'processors' should be dict or str, "
              f"but got {type(processors).__name__} instead."
          )
  
      if isinstance(package, str):
          package = package.strip().lower()
      elif package is not None:
          raise TypeError(
              f"The parameter 'package' should be str, or a dict if 'processors' is a str, "
              f"but got {type(package).__name__} instead."
          )
  
      return lang, model_dir, package, processors
  
imports: from collections import defaultdict, namedtuple
  import errno
  import hashlib
  import json
  import logging
  import os
  from pathlib import Path
  import requests
  import shutil
  import tempfile
  import zipfile
  from tqdm.auto import tqdm
  from stanza.utils.helper_func import make_table
  from stanza.pipeline._constants import TOKENIZE, MWT, POS, LEMMA, DEPPARSE, NER, SENTIMENT
  from stanza.pipeline.registry import PIPELINE_NAMES, PROCESSOR_VARIANTS
  from stanza.resources.default_packages import PACKAGES
  from stanza._version import __resources_version__
label_desc: Use image node_id 15 for calling a global function with example usage: process_pipeline_parameters(lang, model_dir, package, processors) and returns: lang,  model_dir,  package,  processors