code: def test_repr_niimgs_with_niimg(
      shorten, tmp_path, affine_eye, img_3d_ones_eye, shape_3d_default
  ):
      # Shorten has no effect in this case
      assert _utils._repr_niimgs(
          img_3d_ones_eye, shorten=shorten
      ).replace("10L", "10") == (
          "%s(\nshape=%s,\naffine=%s\n)"
          % (
              img_3d_ones_eye.__class__.__name__,
              repr(shape_3d_default),
              repr(affine_eye),
          )
      )
  
      # Add filename long enough to qualify for shortening
      fd, tmpimg1 = tempfile.mkstemp(
          suffix="_very_long.nii", dir=str(tmp_path)
      )
      os.close(fd)
      nibabel.save(img_3d_ones_eye, tmpimg1)
      class_name = img_3d_ones_eye.__class__.__name__
      filename = Path(img_3d_ones_eye.get_filename())
      assert (
          _utils._repr_niimgs(img_3d_ones_eye, shorten=False)
          == f"{class_name}('{filename}')"
      )
      assert (
          _utils._repr_niimgs(img_3d_ones_eye, shorten=True)
          == f"{class_name}('{Path(filename).name[:18]}...')"
      )
  
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 18 for calling a global function with example usage: test_repr_niimgs_with_niimg(shorten, tmp_path, affine_eye, img_3d_ones_eye, shape_3d_default) without return types