code: def testErrors(self):
      with self.assertRaisesRegex(
          ValueError, r"should have the same length"
      ):
          dataset_ops.Dataset.sample_from_datasets(
              [
                  dataset_ops.Dataset.range(10),
                  dataset_ops.Dataset.range(20),
              ],
              weights=[0.25, 0.25, 0.25, 0.25],
          )
  
      with self.assertRaisesRegex(
          TypeError, "`tf.float32` or `tf.float64`"
      ):
          dataset_ops.Dataset.sample_from_datasets(
              [
                  dataset_ops.Dataset.range(10),
                  dataset_ops.Dataset.range(20),
              ],
              weights=[1, 1],
          )
  
      with self.assertRaisesRegex(TypeError, "must have compatible"):
          dataset_ops.Dataset.sample_from_datasets(
              [
                  dataset_ops.Dataset.from_tensors(0),
                  dataset_ops.Dataset.from_tensors(0.0),
              ]
          )
  
      with self.assertRaisesRegex(
          ValueError,
          r"Invalid `datasets`. `datasets` should not be empty.",
      ):
          dataset_ops.Dataset.sample_from_datasets(
              datasets=[], weights=[]
          )
  
imports: from absl.testing import parameterized
  import numpy
  from tensorflow.python.compat import compat
  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.eager import def_function
  from tensorflow.python.framework import combinations
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import random_seed
  from tensorflow.python.platform import test
label_desc: Use image node_id 15 for calling the SampleFromDatasetsTest obj's underlying member method code with example usage: obj.testErrors() without return types