code: def test_is_compatible(self):
      yes = self.assertIsCompatible
      no = self.assertIsNotCompatible
  
      # Any
      yes(0, typing.Any)
      yes(0.0, typing.Any)
      yes("a", typing.Any)
      yes(False, typing.Any)
      yes([], typing.Any)
      yes((), typing.Any)
      yes({}, typing.Any)
  
      # Primitives
      yes(0, int)
      no(0, str)
      yes(0.0, float)
      no(0.0, int)
      yes(False, bool)
      yes(False, int)
      yes("a", str)
      no("a", int)
  
      # Non-types
      yes(None, None)
      yes(None, type(None))
      no(0, None)
  
      # Lists
      yes([0], list)
      yes([0], typing.List)
      yes([0], typing.List[int])
      yes([0], typing.Iterable)
      yes([0], typing.Iterable[int])
      yes([0], typing.Sequence[int])
      yes([0], typing.MutableSequence[int])
      yes([], typing.List[int])  # Empty list
      no([0], typing.List[str])
      no(["a", 0], typing.List[str])  # Heterogeneous list
      yes([[0.0, 1.0], [1.0, 0.0]], typing.List[typing.List[float]])
  
      # Sets
      yes({0}, set)
      yes({0}, typing.Set)
      yes({0}, typing.Set[int])
      no({0}, typing.Set[float])
  
      # Tuples
      yes((), tuple)
      yes((), typing.Tuple)
      yes(("a", 0), typing.Tuple)
      no(["a", 0], typing.Tuple)
      yes((0, 1, 2, 3), typing.Tuple[int, ...])  # Ellipsis
      no((0, 1, 2, "a"), typing.Tuple[int, ...])  # Ellipsis
      yes((0, "a", ()), typing.Tuple[int, str, tuple])
  
      # Dictionaries
      yes({"a": 0}, dict)
      yes({"a": 0}, typing.Dict)
      yes({"a": 0}, typing.Dict[str, int])
      no([], typing.Dict[str, str])
      no({"a": 0}, typing.Dict[int, int])  # Wrong key type
      no({"a": 0}, typing.Dict[str, str])  # Wrong value type
      yes({"a": [0, 1, 2, 3]}, typing.Dict[str, typing.List[int]])
      yes(
          {"a": [0, 1, 2, 3]}, typing.Mapping[str, typing.Sequence[int]]
      )
      no({"a": [0, "a"]}, typing.Dict[str, typing.List[int]])
      no({"a": 0, "b": 0.0}, typing.Dict[str, int])
      no({"a": 0, 0: "a"}, typing.Dict[str, int])
      yes(
          {"a": 0, 0: "a"},
          typing.Dict[typing.Union[str, int], typing.Union[str, int]],
      )
  
      # Types
      class Foo:
          pass
  
      class SubFoo(Foo):
          pass
  
      yes(int, type)
      yes(int, typing.Type[int])
      yes(bool, typing.Type[int])
      yes(SubFoo, typing.Type[Foo])
      no(int, typing.Type[Foo])
      yes(str, typing.Type[typing.Union[str, int]])
      yes(int, typing.Type[typing.Union[str, int]])
      no(float, typing.Type[typing.Union[str, int]])
  
      # Unions
      long_union = typing.Union[
          int, str, typing.Union[tuple, typing.List[int]]
      ]
      yes(0, long_union)
      yes("a", long_union)
      yes(("a", 0), long_union)
      yes([0, 1], long_union)
      no(0.0, long_union)
      no([0, "a"], long_union)
  
      # Optional
      yes(0, typing.Optional[int])
      yes(None, typing.Optional[int])
      yes([0], typing.Optional[typing.List[int]])
      yes(None, typing.Optional[typing.List[int]])
      yes({"a": 0}, typing.Optional[typing.Dict[str, int]])
      yes(None, typing.Optional[typing.Dict[str, int]])
  
      # Literal
      literal = Literal["a", "b", "c"]
      yes("a", literal)
      yes("b", literal)
      yes("c", literal)
      no("d", literal)
      no(0, literal)
  
imports: import sys
  import typing
  from typing import Any, List, Literal, TypedDict
  import unittest
  import tensorflow
  import tfx.types
  from tfx.types import standard_artifacts
  from tfx.utils import typing_utils
  import typing_extensions
  import ml_metadata
label_desc: Use image node_id 7 for calling the TypingUtilsTest obj's underlying member method code with example usage: obj.test_is_compatible() without return types