code: def testDeterminismConfiguration(
      self, local_determinism, global_determinism
  ):
      expect_determinism = local_determinism or (
          local_determinism is None and global_determinism
      )
      elements = list(range(100))
  
      def dataset_fn(delay_ms):
          def sleep(x):
              time.sleep(delay_ms / 1000)
              return x
  
          def map_function(x):
              if math_ops.equal(x, 0):
                  return script_ops.py_func(sleep, [x], x.dtype)
              else:
                  return x
  
          dataset = dataset_ops.Dataset.from_tensor_slices(elements)
          dataset = dataset.map(
              map_function,
              num_parallel_calls=2,
              deterministic=local_determinism,
          )
          dataset = dataset.batch(
              batch_size=6,
              num_parallel_calls=2,
              deterministic=local_determinism,
          ).unbatch()
          opts = options_lib.Options()
          opts.deterministic = global_determinism
          dataset = dataset.with_options(opts)
          return dataset
  
      self.checkDeterminism(dataset_fn, expect_determinism, elements)
  
imports: import time
  from absl.testing import parameterized
  import numpy
  from tensorflow.python.checkpoint import checkpoint
  from tensorflow.python.checkpoint import checkpoint_management
  from tensorflow.python.data.experimental.ops import random_access
  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.data.util import nest
  from tensorflow.python.framework import combinations
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import sparse_tensor
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import script_ops
  from tensorflow.python.ops.ragged import ragged_concat_ops
  from tensorflow.python.ops.ragged import ragged_factory_ops
  from tensorflow.python.ops.ragged import ragged_math_ops
  from tensorflow.python.ops.ragged import ragged_tensor
  from tensorflow.python.platform import test
label_desc: Use image node_id 12 for calling the BatchTest obj's underlying member method code with example usage: obj.testDeterminismConfiguration(local_determinism, global_determinism) and returns: dataset, x, script_ops, x