code: def testErrorCases(self):
      kernel = exponentiated_quadratic.ExponentiatedQuadratic()
      index_points = np.random.uniform(-1.0, 1.0, (10, 1)).astype(
          np.float64
      )
      observation_index_points = np.random.uniform(
          -1.0, 1.0, (5, 1)
      ).astype(np.float64)
      observations = np.random.uniform(-1.0, 1.0, 3).astype(np.float64)
  
      # Both or neither of `observation_index_points` and `observations` must be
      # specified.
      with self.assertRaises(ValueError):
          gprm.GaussianProcessRegressionModel(
              kernel,
              index_points,
              observation_index_points=None,
              observations=observations,
              validate_args=True,
          )
      with self.assertRaises(ValueError):
          gprm.GaussianProcessRegressionModel(
              kernel,
              index_points,
              observation_index_points,
              observations=None,
              validate_args=True,
          )
  
      # If specified, mean_fn must be a callable.
      with self.assertRaises(ValueError):
          gprm.GaussianProcessRegressionModel(
              kernel, index_points, mean_fn=0.0, validate_args=True
          )
  
      # Observation index point and observation counts must be broadcastable.
      # Errors based on conditions of dynamic shape in graph mode cannot be
      # caught, so we only check this error case in static shape or eager mode.
      if self.is_static or tf.executing_eagerly():
          with self.assertRaises(ValueError):
              gprm.GaussianProcessRegressionModel(
                  kernel,
                  index_points,
                  observation_index_points=np.ones([2, 2, 2]),
                  observations=np.ones([5, 5]),
                  validate_args=True,
              )
  
imports: from unittest import mock
  from absl.testing import parameterized
  import numpy
  import tensorflow.compat.v1
  import tensorflow.compat.v2
  from tensorflow_probability.python.distributions import gaussian_process
  from tensorflow_probability.python.distributions import gaussian_process_regression_model
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math.psd_kernels import exp_sin_squared
  from tensorflow_probability.python.math.psd_kernels import exponentiated_quadratic
  from tensorflow_probability.python.math.psd_kernels.internal import test_util
label_desc: Use image node_id 7 for calling the _GaussianProcessRegressionModelTest obj's underlying member method code with example usage: obj.testErrorCases() without return types