code: def add_dependencies(resources, lang, processor_list):
      """
      Expand the processor_list as given in maintain_processor_list to have the dependencies
  
      Still a list of model types to ModelSpecifications
      the dependencies are tuples: name and package
      for example:
      [['pos', (ModelSpecification(processor='pos', package='gsd', dependencies=(('pretrain', 'gsd'),)),)],
       ['depparse', (ModelSpecification(processor='depparse', package='gsd', dependencies=(('pretrain', 'gsd'),)),)]]
      """
      lang_resources = resources[lang]
      for item in processor_list:
          processor, model_specs = item
          new_model_specs = []
          for model_spec in model_specs:
              # skip dependency checking for external variants of processors and identity lemmatizer
              if not any(
                  [
                      model_spec.package
                      in PROCESSOR_VARIANTS[processor],
                      processor == LEMMA
                      and model_spec.package == "identity",
                  ]
              ):
                  dependencies = (
                      lang_resources.get(processor, {})
                      .get(model_spec.package, {})
                      .get("dependencies", [])
                  )
                  dependencies = [
                      (dependency["model"], dependency["package"])
                      for dependency in dependencies
                  ]
                  model_spec = model_spec._replace(
                      dependencies=tuple(dependencies)
                  )
                  logger.debug(
                      "Found dependencies %s for processor %s model %s",
                      dependencies,
                      processor,
                      model_spec.package,
                  )
              new_model_specs.append(model_spec)
          item[1] = tuple(new_model_specs)
      return processor_list
  
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 12 for calling a global function with example usage: add_dependencies(resources, lang, processor_list) and returns: processor_list