code: def test_csa_header_read():
      hdr = csa.get_csa_header(DATA, "image")
      assert hdr["n_tags"] == 83
      assert csa.get_csa_header(DATA, "series")["n_tags"] == 65
      with pytest.raises(ValueError):
          csa.get_csa_header(DATA, "xxxx")
      assert csa.is_mosaic(hdr)
      # Get a shallow copy of the data, lacking the CSA marker
      # Need to do it this way because del appears broken in pydicom 0.9.7
      data2 = pydicom.dataset.Dataset()
      for element in DATA:
          if (element.tag.group, element.tag.elem) != (0x29, 0x10):
              data2.add(element)
      assert csa.get_csa_header(data2, "image") is None
      # Add back the marker - CSA works again
      data2[(0x29, 0x10)] = DATA[(0x29, 0x10)]
      assert csa.is_mosaic(csa.get_csa_header(data2, "image"))
  
file_path: nibabel/nibabel/nicom/tests/test_csareader.py
imports: import gzip
  import sys
  from copy import deepcopy
  from os.path import join
  import numpy
  import pytest
  from ..None import csareader
  from ..None import dwiparams
  from .None import dicom_test, pydicom
  from .test_dicomwrappers import DATA, IO_DATA_PATH
label_desc: Use image node_id 1 for calling a global function with example usage: test_csa_header_read() without return types