code: def testErrors(self):
      with self.assertRaisesRegex(TypeError, "tf.int64"):
          dataset_ops.Dataset.choose_from_datasets(
              [
                  dataset_ops.Dataset.from_tensors(0),
                  dataset_ops.Dataset.from_tensors(1),
              ],
              choice_dataset=dataset_ops.Dataset.from_tensors(1.0),
          )
  
      with self.assertRaisesRegex(TypeError, "scalar"):
          dataset_ops.Dataset.choose_from_datasets(
              [
                  dataset_ops.Dataset.from_tensors(0),
                  dataset_ops.Dataset.from_tensors(1),
              ],
              choice_dataset=dataset_ops.Dataset.from_tensors([1.0]),
          )
  
      with self.assertRaisesRegex(
          errors.InvalidArgumentError, "out of range"
      ):
          dataset = dataset_ops.Dataset.choose_from_datasets(
              [dataset_ops.Dataset.from_tensors(0)],
              choice_dataset=dataset_ops.Dataset.from_tensors(
                  constant_op.constant(1, dtype=dtypes.int64)
              ),
          )
          next_element = self.getNext(dataset)
          self.evaluate(next_element())
  
      with self.assertRaisesRegex(
          ValueError,
          r"Invalid `datasets`. `datasets` should not be empty.",
      ):
          dataset_ops.Dataset.choose_from_datasets(
              datasets=[],
              choice_dataset=dataset_ops.Dataset.from_tensors(1.0),
          )
  
      with self.assertRaisesRegex(
          TypeError, r"`choice_dataset` should be a `tf.data.Dataset`"
      ):
          datasets = [dataset_ops.Dataset.range(42)]
          dataset_ops.Dataset.choose_from_datasets(
              datasets, choice_dataset=None
          )
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.data.kernel_tests import checkpoint_test_base
  from tensorflow.python.data.kernel_tests import test_base
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.data.ops import options
  from tensorflow.python.framework import combinations
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.ops import stateless_random_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 6 for calling the ChooseFromDatasetsTest obj's underlying member method code with example usage: obj.testErrors() without return types