code: def default_name_formatter(
      metadict: dict, saver: monai.transforms.Transform
  ) -> dict:
      """Returns a kwargs dict for :py:meth:`FolderLayout.filename`,
      according to the input metadata and SaveImage transform."""
      subject = (
          metadict.get(
              monai.utils.ImageMetaKey.FILENAME_OR_OBJ,
              getattr(saver, "_data_index", 0),
          )
          if metadict
          else getattr(saver, "_data_index", 0)
      )
      patch_index = (
          metadict.get(monai.utils.ImageMetaKey.PATCH_INDEX, None)
          if metadict
          else None
      )
      return {"subject": f"{subject}", "idx": patch_index}
  
file_path: MONAI/monai/data/folder_layout.py
imports: from __future__ import annotations
  from abc import ABC, abstractmethod
  import monai
  from monai.config import PathLike
  from monai.data.utils import create_file_basename
label_desc: Use image node_id 1 for calling a global function with example usage: default_name_formatter(metadict, saver) and returns: dict