code: def test_get_from_wrapper():
      # Test that 'get', and __getitem__ work as expected for underlying dicom
      # data
      dcm_data = {"some_key": "some value"}
      dw = didw.Wrapper(dcm_data)
      assert dw.get("some_key") == "some value"
      assert dw.get("some_other_key") is None
      # Getitem uses the same dictionary access
      assert dw["some_key"] == "some value"
      # And raises a WrapperError for missing keys
      with pytest.raises(KeyError):
          dw["some_other_key"]
      # Test we don't use attributes for get
  
      class FakeData(dict):
          pass
  
      d = FakeData()
      d.some_key = "another bit of data"
      dw = didw.Wrapper(d)
      assert dw.get("some_key") is None
      # Check get defers to dcm_data get
  
      class FakeData2:
          def get(self, key, default):
              return 1
  
      d = FakeData2()
      d.some_key = "another bit of data"
      dw = didw.Wrapper(d)
      assert dw.get("some_key") == 1
  
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 2 for calling a global function with example usage: test_get_from_wrapper() and returns: int