code: def check_missing_files(
      datalist: list[dict],
      keys: KeysCollection,
      root_dir: PathLike | None = None,
      allow_missing_keys: bool = False,
  ):
      """Checks whether some files in the Decathlon datalist are missing.
      It would be helpful to check missing files before a heavy training run.
  
      Args:
          datalist: a list of data items, every item is a dictionary.
              usually generated by `load_decathlon_datalist` API.
          keys: expected keys to check in the datalist.
          root_dir: if not None, provides the root dir for the relative file paths in `datalist`.
          allow_missing_keys: whether allow missing keys in the datalist items.
              if False, raise exception if missing. default to False.
  
      Returns:
          A list of missing filenames.
  
      """
      missing_files = []
      for item in datalist:
          for k in ensure_tuple(keys):
              if k not in item:
                  if not allow_missing_keys:
                      raise ValueError(
                          f"key `{k}` is missing in the datalist item: {item}"
                      )
                  continue
  
              for f in ensure_tuple(item[k]):
                  if not isinstance(f, (str, os.PathLike)):
                      raise ValueError(
                          f"filepath of key `{k}` must be a string or a list of strings, but got: {f}."
                      )
                  f = Path(f)
                  if isinstance(root_dir, (str, os.PathLike)):
                      f = Path(root_dir).joinpath(f)
                  if not f.exists():
                      missing_files.append(f)
  
      return missing_files
  
file_path: MONAI/monai/data/decathlon_datalist.py
imports: from __future__ import annotations
  import json
  import os
  import warnings
  from collections.abc import Sequence
  from pathlib import Path
  from typing import overload
  from monai.config import KeysCollection, PathLike
  from monai.data.utils import partition_dataset, select_cross_validation_folds
  from monai.utils import ensure_tuple
label_desc: Use image node_id 7 for calling a global function with example usage: check_missing_files(datalist, keys, root_dir, allow_missing_keys) and returns: missing_files