code: def is_instance(
      val: Any,
      expected: Union[Type, Tuple[Type, ...]],
      reason: Optional[str] = None,
  ) -> None:
      if isinstance(val, expected):
          return
  
      msg = "CHECK FAILED! {} has type {}, expected isinstance of {}".format(
          val, type(val), expected
      )
      if reason is not None:
          msg += ": {}".format(reason)
  
      raise CheckFailedError(msg)
  
imports: from typing import Any, Container, Optional, Sized, Tuple, Type, Union
label_desc: Use image node_id 31 for calling a global function with example usage: is_instance(val, expected, reason) without return types