code: def get_config_downloads(
      config: Union[str, Path, dict]
  ) -> Set[Tuple[str, Path]]:
      config = parse_config(config)
  
      downloads = set()
      if "metadata" in config and "download" in config["metadata"]:
          for resource in config["metadata"]["download"]:
              if isinstance(resource, str):
                  resource = {"url": resource}
  
              url = resource["url"]
              dest = expand_path(resource.get("subdir", ""))
  
              downloads.add((url, dest))
  
      config_references = [
          expand_path(config_ref)
          for config_ref in get_all_elems_from_json(
              config, "config_path"
          )
      ]
  
      downloads |= {
          (url, dest)
          for config in config_references
          for url, dest in get_config_downloads(config)
      }
  
      return downloads
  
imports: import secrets
  import shutil
  import sys
  from argparse import ArgumentParser, Namespace
  from collections import defaultdict
  from logging import getLogger
  from pathlib import Path
  from typing import Union, Optional, Dict, Iterable, Set, Tuple, List
  from urllib.parse import urlparse
  import requests
  from filelock import FileLock
  import deeppavlov
  from deeppavlov.core.commands.utils import expand_path, parse_config
  from deeppavlov.core.data.utils import download, download_decompress, get_all_elems_from_json, file_md5, set_query_parameter, path_set_md5, get_download_token
label_desc: Use image node_id 1 for calling a global function with example usage: get_config_downloads(config) and returns: downloads