code: def test_inheritance_and_multiple_dispatch():
      @dispatch(A, A)
      def f(x, y):  # noqa:F811
          return type(x), type(y)
  
      @dispatch(A, B)  # noqa:F811
      def f(x, y):  # noqa:F811
          return 0
  
      assert f(A(), A()) == (A, A)
      assert f(A(), C()) == (A, C)
      assert f(A(), B()) == 0
      assert f(C(), B()) == 0
      assert raises(NotImplementedError, lambda: f(B(), B()))
  
imports: from __future__ import annotations
  from typing import Any
  from sympy.multipledispatch import dispatch
  from sympy.multipledispatch.conflict import AmbiguityWarning
  from sympy.testing.pytest import raises, warns
  from functools import partial
label_desc: Use image node_id 4 for calling a global function with example usage: test_inheritance_and_multiple_dispatch() and returns: type,  type, int