code: def test_read_nifti2():
      # Error trying to read a CIFTI-2 image from a NIfTI2-only image.
      filemap = ci.Cifti2Image.make_file_map()
      for k in filemap:
          filemap[k].fileobj = open(NIFTI2_DATA)
      with pytest.raises(ValueError):
          ci.Cifti2Image.from_file_map(filemap)
  
imports: import io
  from os.path import dirname
  from os.path import join
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal
  from packaging.version import Version
  import nibabel
  from nibabel import cifti2
  from nibabel.cifti2.parse_cifti2 import _Cifti2AsNiftiHeader
  from nibabel.tests import test_nifti2
  from nibabel.tests.nibabel_data import get_nibabel_data, needs_nibabel_data
  from nibabel.tmpdirs import InTemporaryDirectory
label_desc: Use image node_id 2 for calling a global function with example usage: test_read_nifti2() without return types