code: def test_related_types(self):
      class MockAlwaysSuperType(trace.TraceType):
          def is_subtype_of(self, other: trace.TraceType) -> bool:
              return False
  
          def most_specific_common_supertype(self, others):
              return self
  
          def placeholder_value(self, placeholder_context):
              raise NotImplementedError
  
          def __eq__(self, other):
              return self is other
  
          def __hash__(self):
              return 0
  
      supertype = MockAlwaysSuperType()
  
      class MockAlwaysSubtype(trace.TraceType):
          def is_subtype_of(self, other) -> bool:
              return True
  
          def most_specific_common_supertype(self, others):
              return supertype
  
          def placeholder_value(self, placeholder_context):
              raise NotImplementedError
  
          def __eq__(self, other):
              return self is other
  
          def __hash__(self):
              return 1
  
      subtype = MockAlwaysSubtype()
  
      foo_type = function_type.FunctionType(
          [
              function_type.Parameter(
                  "x",
                  function_type.Parameter.POSITIONAL_ONLY,
                  False,
                  supertype,
              ),
          ]
      )
      bar_type = function_type.FunctionType(
          [
              function_type.Parameter(
                  "x",
                  function_type.Parameter.POSITIONAL_ONLY,
                  False,
                  subtype,
              )
          ]
      )
  
      self.assertNotEqual(foo_type, bar_type)
      self.assertTrue(bar_type.is_supertype_of(foo_type))
      self.assertFalse(foo_type.is_supertype_of(bar_type))
  
      self.assertEqual(
          foo_type.most_specific_common_subtype([bar_type, foo_type]),
          foo_type,
      )
      self.assertEqual(
          bar_type.most_specific_common_subtype([bar_type, foo_type]),
          foo_type,
      )
  
imports: import collections
  import pickle
  import platform
  from absl.testing import parameterized
  from tensorflow.core.function import trace_type
  from tensorflow.core.function.polymorphism import function_type
  from tensorflow.core.function.polymorphism import function_type_pb2
  from tensorflow.core.function.trace_type import serialization
  from tensorflow.python.framework import func_graph
  from tensorflow.python.platform import test
  from tensorflow.python.types import trace
label_desc: Use image node_id 4 for calling the TypeHierarchyTest obj's underlying member method code with example usage: obj.test_related_types() and returns: False, self, unknown, int, True, supertype, unknown, int