code: def test_save_dicoms_realtime(tmp_path, dd=data_dict):
      dd = dd.copy()
      start_time = time.time()
  
      dd["save_dicom"] = True
      dd["save_realtime"] = True
  
      # test when ROI files are not set
      dd["ROI_A_file"] = None
      dd["ROI_B_file"] = None
      dd["template_path"] = None
      dd["noise_dict_file"] = None
  
      # Run the simulation
      gen.generate_data(str(tmp_path), dd)
  
      end_time = time.time()
  
      # Check it took 2s per TR
      assert (end_time - start_time) > 60, "Realtime ran fast"
  
      # Check correct file number
      file_path = str(tmp_path / "*.dcm")
      assert len(glob.glob(file_path)) == 30, "Wrong dicom file num"
  
file_path: brainiak/tests/utils/test_fmrisim_real_time.py
imports: import numpy
  from brainiak.utils import fmrisim_real_time_generator
  import pytest
  import os
  import time
  import glob
  from pkg_resources import resource_stream
  from typing import Dict
  from nibabel.nifti1 import Nifti1Image
  import gzip
label_desc: Use image node_id 4 for calling a global function with example usage: test_save_dicoms_realtime(tmp_path, dd) without return types