code: def test_check_niimg_pathlike(img_3d_zeros_eye, tmp_path):
      filename = testing.write_imgs_to_path(
          img_3d_zeros_eye, file_path=tmp_path, create_files=True
      )
      filename = Path(filename)
      _utils.check_niimg_3d(filename)
  
imports: import os
  import re
  import tempfile
  from pathlib import Path
  import nibabel
  import numpy
  import pytest
  from nibabel import Nifti1Image
  from numpy.testing import assert_array_equal
  import nilearn
  from nilearn import _utils
  from nilearn._utils import niimg_conversions, testing
  from nilearn._utils.exceptions import DimensionError
  from nilearn._utils.niimg_conversions import iter_check_niimg
  from nilearn._utils.testing import assert_memory_less_than, with_memory_profiler
  from nilearn.image import get_data
label_desc: Use image node_id 6 for calling a global function with example usage: test_check_niimg_pathlike(img_3d_zeros_eye, tmp_path) without return types