code: def test_truncated_file(tmp_path):
      path = tmp_path / "test.png"
      path_t = tmp_path / "test_truncated.png"
      plt.savefig(path)
      with open(path, "rb") as fin:
          buf = fin.read()
      with open(path_t, "wb") as fout:
          fout.write(buf[:20])
  
      with pytest.raises(Exception):
          plt.imread(path_t)
  
file_path: matplotlib/lib/matplotlib/tests/test_png.py
imports: from io import BytesIO
  from pathlib import Path
  import pytest
  from matplotlib.testing.decorators import image_comparison
  from matplotlib import cm, pyplot
label_desc: Use image node_id 2 for calling a global function with example usage: test_truncated_file(tmp_path) without return types