code: def is_compatible_type(t1: AnyType, t2: AnyType) -> bool:
      """
      A very loose check that it is possible for an object to be both an instance of ``t1``
      and an instance of ``t2``.
  
      Note: this will resolve ``LazyType``s, so should not be used in any
      peformance-critical contexts.
      """
      if get_origin(t1) is t.Union:
          return any(
              (
                  is_compatible_type(t2, arg_type)
                  for arg_type in get_args(t1)
              )
          )
  
      if get_origin(t2) is t.Union:
          return any(
              (
                  is_compatible_type(t1, arg_type)
                  for arg_type in get_args(t2)
              )
          )
  
      if isinstance(t1, LazyType):
          t1 = t1.get_class()
  
      if isinstance(t2, LazyType):
          t2 = t2.get_class()
  
      if isinstance(t1, type) and isinstance(t2, type):
          return issubclass(t1, t2) or issubclass(t2, t1)
  
      # catchall return true in unsupported cases so we don't error on unsupported types
      return True
  
imports: from __future__ import annotations
  import io
  import logging
  import os
  import sys
  import typing
  from dataclasses import dataclass
  from datetime import date
  from datetime import datetime
  from datetime import time
  from datetime import timedelta
  from types import TracebackType
  from typing import get_args
  from typing import get_origin
label_desc: Use image node_id 1 for calling a global function with example usage: is_compatible_type(t1, t2) and returns: True, any, any, unknown