code: def testSampleFromDatasetsRerandomizeInsideFunction(
      self, rerandomize
  ):
      if rerandomize is not None and not tf_compat.forward_compatible(
          2022, 12, 17
      ):
          self.skipTest(
              "target functionality not available due to forward compatibility"
          )
  
      @def_function.function
      def make_dataset():
          dataset1 = dataset_ops.Dataset.range(0, 10)
          dataset2 = dataset_ops.Dataset.range(100, 110)
          sample_dataset = dataset_ops.Dataset.sample_from_datasets(
              [dataset1, dataset2],
              seed=42,
              weights=[0.5, 0.5],
              stop_on_empty_dataset=True,
              rerandomize_each_iteration=rerandomize,
          )
          return sample_dataset
  
      sample_dataset = make_dataset()
      first_epoch = self.getDatasetOutput(sample_dataset)
      second_epoch = self.getDatasetOutput(sample_dataset)
  
      if rerandomize:
          self.assertNotEqual(first_epoch, second_epoch)
      else:
          self.assertEqual(first_epoch, second_epoch)
  
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 14 for calling the SampleFromDatasetsTest obj's underlying member method code with example usage: obj.testSampleFromDatasetsRerandomizeInsideFunction(rerandomize) and returns: sample_dataset