code: def _is_subclass(cls: type[Any], type_hint: Any) -> bool:
      """issubclass that supports Union and Optional correctly."""
      if inspect.isclass(type_hint) or sys.version_info >= (3, 10):
          # issubclass recognizes Optional / Union type in python>=3.10
          return issubclass(cls, type_hint)
      origin = get_origin(type_hint)
      args = get_args(type_hint)
      if origin is Union:
          if any(_is_subclass(cls, arg) for arg in args):
              return True
      return False
  
imports: import abc
  import functools
  import inspect
  import sys
  from typing import Any, Callable, Generic, Optional, TypeVar, Union, get_args, get_origin
  from tfx.utils import pure_typing_utils
label_desc: Use image node_id 1 for calling a global function with example usage: _is_subclass(cls, type_hint) and returns: False, issubclass, True