code: def testDeterminismConfiguration(
      self, local_determinism, global_determinism
  ):
      expect_determinism = local_determinism or (
          local_determinism is None and global_determinism
      )
      elements = list(range(1000))
  
      def dataset_fn(delay_ms):
          def interleave_fn(x):
              ds = dataset_ops.Dataset.from_tensors(x)
              if math_ops.equal(x, 0):
                  ds = ds.apply(testing.sleep(delay_ms * 1000))
              else:
                  ds = ds.apply(testing.sleep(0))
              return ds
  
          dataset = dataset_ops.Dataset.from_tensor_slices(elements)
          dataset = dataset.interleave(
              interleave_fn,
              cycle_length=10,
              num_parallel_calls=10,
              deterministic=local_determinism,
          )
          opts = options_lib.Options()
          opts.deterministic = global_determinism
          dataset = dataset.with_options(opts)
          return dataset
  
      self.checkDeterminism(dataset_fn, expect_determinism, elements)
  
imports: import multiprocessing
  import os
  from absl.testing import parameterized
  import numpy
  from tensorflow.python.data.experimental.ops import testing
  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 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 sparse_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 8 for calling the InterleaveTest obj's underlying member method code with example usage: obj.testDeterminismConfiguration(local_determinism, global_determinism) and returns: dataset, ds