code: def error_if_not_real_or_complex(tensor, identifier):
      """Raise a `TypeError` if the `Tensor` is neither real nor complex."""
      if not (
          dtype_util.is_floating(tensor.dtype)
          or dtype_util.is_complex(tensor.dtype)
      ):
          raise TypeError(
              "`{}` must have a floating point or complex floating point dtype.".format(
                  identifier
              )
          )
  
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.math import gradient
  from tensorflow.python.util import nest
label_desc: Use image node_id 4 for calling a global function with example usage: error_if_not_real_or_complex(tensor, identifier) without return types