code: def test_wrappers():
      # test direct wrapper calls
      # first with empty or minimal data
      multi_minimal = {
          "PerFrameFunctionalGroupsSequence": [None],
          "SharedFunctionalGroupsSequence": [None],
      }
      for maker, args in (
          (didw.Wrapper, ({},)),
          (didw.SiemensWrapper, ({},)),
          (didw.MosaicWrapper, ({}, None, 10)),
          (didw.MultiframeWrapper, (multi_minimal,)),
      ):
          dw = maker(*args)
          assert dw.get("InstanceNumber") is None
          assert dw.get("AcquisitionNumber") is None
          with pytest.raises(KeyError):
              dw["not an item"]
          with pytest.raises(didw.WrapperError):
              dw.get_data()
          with pytest.raises(didw.WrapperError):
              dw.affine
          with pytest.raises(TypeError):
              maker()
          # Check default attributes
          if not maker is didw.MosaicWrapper:
              assert not dw.is_mosaic
          assert dw.b_matrix is None
          assert dw.q_vector is None
      for maker in (
          didw.wrapper_from_data,
          didw.Wrapper,
          didw.SiemensWrapper,
          didw.MosaicWrapper,
      ):
          dw = maker(DATA)
          assert dw.get("InstanceNumber") == 2
          assert dw.get("AcquisitionNumber") == 2
          with pytest.raises(KeyError):
              dw["not an item"]
      for maker in (didw.MosaicWrapper, didw.wrapper_from_data):
          dw = maker(DATA)
          assert dw.is_mosaic
      # DATA is not a Multiframe DICOM file
      with pytest.raises(didw.WrapperError):
          didw.MultiframeWrapper(DATA)
  
imports: import gzip
  from copy import copy
  from decimal import Decimal
  from hashlib import sha1
  from os.path import dirname
  from os.path import join
  from unittest import TestCase
  import numpy
  import pytest
  from numpy.testing import assert_array_almost_equal, assert_array_equal
  from ...tests.nibabel_data import get_nibabel_data, needs_nibabel_data
  from ...volumeutils import endian_codes
  from ..None import dicomreaders
  from ..None import dicomwrappers
  from .None import dicom_test, have_dicom, pydicom
label_desc: Use image node_id 1 for calling a global function with example usage: test_wrappers() without return types