code: def test_properties(test_images, tmp_path):
      fname = test_images / "test_000_.SPE"
      props0 = iio.improps(fname, index=0)
      assert props0.shape == (32, 32)
      assert props0.dtype == np.uint16
      assert props0.n_images is None
      assert not props0.is_batch
  
      props = iio.improps(fname, index=...)
      assert props.shape == (2, 32, 32)
      assert props.dtype == np.uint16
      assert props.n_images == 2
      assert props.is_batch
  
      patched = tmp_path / fname.name
      shutil.copy(fname, patched)
      with patched.open("r+b") as f:
          # Set incorrect number of images
          f.seek(1446)
          f.write(struct.pack("<i", 3))
  
      # Test `check_filesize`
      with iio.imopen(patched, "r", check_filesize=False) as img:
          assert (
              img.properties(
                  index=...,
              ).n_images
              == 3
          )
      with pytest.warns():
          with iio.imopen(patched, "r", check_filesize=True) as img:
              assert (
                  img.properties(
                      index=...,
                  ).n_images
                  == 2
              )
  
file_path: imageio/tests/test_spe.py
imports: from datetime import datetime
  import os
  import shutil
  import struct
  import numpy
  import pytest
  import imageio.v3
  from imageio.plugins import spe
label_desc: Use image node_id 6 for calling a global function with example usage: test_properties(test_images, tmp_path) without return types