code: def _check_type(variable, variable_name, expected_type):
      """Helper function for checking that inputs are of expected types."""
      if isinstance(expected_type, (list, tuple)):
          expected_type_name = "list or tuple"
      else:
          expected_type_name = expected_type.__name__
      if not isinstance(variable, expected_type):
          raise ValueError(
              "{} must be of type {}, but it is {}".format(
                  variable_name,
                  expected_type_name,
                  type(variable).__name__,
              )
          )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import itertools
  from typing import Any, List, Optional, Tuple, Union
  import numpy
  import six
  from six.moves import range
  from six.moves import zip
  import tensorflow
label_desc: Use image node_id 4 for calling a global function with example usage: _check_type(variable, variable_name, expected_type) without return types