code: def _check_type(obj, expected_types):
      """Check if an object is of the expected type.
  
      Args:
        obj: The object being checked.
        expected_types: (`type` or an iterable of `type`s) The expected `type`(s)
          of obj.
  
      Raises:
          TypeError: If obj is not an instance of expected_type.
      """
      if not isinstance(obj, expected_types):
          raise TypeError(
              "Expected type %s; got type %s"
              % (expected_types, type(obj))
          )
  
imports: import abc
  import re
  import threading
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.python.client import session
  from tensorflow.python.debug.lib import debug_utils
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import stack
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.training import monitored_session
  from tensorflow.python.util import nest
  from tensorflow.python.util.compat import collections_abc
label_desc: Use image node_id 1 for calling a global function with example usage: _check_type(obj, expected_types) without return types