code: def test_dict_getitem(self):
      getitem = _testcapi.dict_getitem
      dct = {"a": 1, "\U0001f40d": 2}
      self.assertEqual(getitem(dct, "a"), 1)
      self.assertIs(getitem(dct, "b"), KeyError)
      self.assertEqual(getitem(dct, "\U0001f40d"), 2)
  
      dct2 = DictSubclass(dct)
      self.assertEqual(getitem(dct2, "a"), 1)
      self.assertIs(getitem(dct2, "b"), KeyError)
  
      with support.catch_unraisable_exception() as cm:
          self.assertIs(getitem({}, []), KeyError)  # unhashable
          self.assertEqual(cm.unraisable.exc_type, TypeError)
          self.assertEqual(
              str(cm.unraisable.exc_value), "unhashable type: 'list'"
          )
  
      self.assertIs(getitem(42, "a"), KeyError)
      self.assertIs(getitem([1], 0), KeyError)
  
imports: import unittest
  from collections import OrderedDict, UserDict
  from types import MappingProxyType
  from test import support
  import _testcapi
label_desc: Use image node_id 8 for calling the CAPITest obj's underlying member method code with example usage: obj.test_dict_getitem() without return types