code: def test_mro(self):
      @singledispatch
      def g(obj):
          return "base"
  
      class A(object):
          pass
  
      class C(A):
          pass
  
      class B(A):
          pass
  
      class D(C, B):
          pass
  
      @g.register(A)
      def g_A(a):
          return "A"
  
      @g.register(B)
      def g_B(b):
          return "B"
  
      self.assertEqual(g(A()), "A")
      self.assertEqual(g(B()), "B")
      self.assertEqual(g(C()), "A")
      self.assertEqual(g(D()), "B")
  
imports: from __future__ import absolute_import
  import sys
  import doctest
  import unittest
  import decimal
  import inspect
  import functools
  import collections
  from collections import defaultdict
  from decorator import dispatch_on, contextmanager, decorator
label_desc: Use image node_id 2 for calling the TestSingleDispatch obj's underlying member method code with example usage: obj.test_mro() and returns: str, str, str