code: def verify_type(
      var_name: str, var, expected_type: Union[type, tuple]
  ):
      try:
          if isinstance(expected_type, tuple):
              type_name = " or ".join(
                  get_type_name(t) for t in expected_type
              )
          else:
              type_name = get_type_name(expected_type)
      except Exception as e:
          # Just to be sure that nothing weird will be raised here
          raise TypeError(
              "Incorrect type of {}".format(var_name)
          ) from e
  
      if not isinstance(var, expected_type):
          raise TypeError(
              "{} must be a {} (was {})".format(
                  var_name, type_name, type(var)
              )
          )
  
      if isinstance(var, IOBase) and not hasattr(var, "read"):
          raise TypeError(
              "{} is a stream, which does not implement read method".format(
                  var_name
              )
          )
  
imports: import base64
  import logging
  import os
  from glob import glob
  from io import IOBase
  from typing import Iterable, List, Mapping, Optional, Set, TypeVar, Union
  from neptune.internal.types.stringify_value import StringifyValue
label_desc: Use image node_id 2 for calling a global function with example usage: verify_type(var_name, var, expected_type) without return types