code: def test_MDNotImplementedError(self):
      Parent = type("Parent", (int,), {})
      Child = type("Child", (Parent,), {})
      with patch.dict(self.dispatcher.funcs, {}):
  
          @self.dispatcher.register(Parent)
          def _method_parent(val) -> str:
              if val < 0:
                  raise MDNotImplementedError  # defer to nothing
              return "parent"
  
          @self.dispatcher.register(Child)
          def _method_child(val) -> str:
              if val % 2:
                  return "child"
              raise MDNotImplementedError  # defer to parent
  
          self.assertEqual(self.dispatcher(Child(1)), "child")
          self.assertEqual(self.dispatcher(Child(2)), "parent")
          self.assertEqual(self.dispatcher(Child(-1)), "child")
          with self.assertRaisesRegex(
              NotImplementedError, "none completed"
          ):
              self.dispatcher(Child(-2))
  
file_path: botorch/test/utils/test_dispatcher.py
imports: from __future__ import annotations
  from contextlib import redirect_stdout
  from inspect import getsource, getsourcefile
  from io import StringIO
  from itertools import product
  from unittest.mock import patch
  from botorch.utils.dispatcher import Dispatcher, MDNotImplementedError
  from botorch.utils.testing import BotorchTestCase
label_desc: Use image node_id 7 for calling the TestDispatcher obj's underlying member method code with example usage: obj.test_MDNotImplementedError() and returns: str, str