code: def _append_paths(
      base_dir: PathLike, is_segmentation: bool, items: list[dict]
  ) -> list[dict]:
      """
      Args:
          base_dir: the base directory of the dataset.
          is_segmentation: whether the datalist is for segmentation task.
          items: list of data items, each of which is a dict keyed by element names.
  
      Raises:
          TypeError: When ``items`` contains a non ``dict``.
  
      """
      for item in items:
          if not isinstance(item, dict):
              raise TypeError(
                  f"Every item in items must be a dict but got {type(item).__name__}."
              )
          for k, v in item.items():
              if k == "image" or is_segmentation and k == "label":
                  item[k] = _compute_path(base_dir, v, check_path=False)
              else:
                  # for other items, auto detect whether it's a valid path
                  item[k] = _compute_path(base_dir, v, check_path=True)
      return items
  
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 4 for calling a global function with example usage: _append_paths(base_dir, is_segmentation, items) and returns: items