code: def test_deterministic_attribute(
      self, local_determinism, global_determinism
  ):
      self._set_seed()
      with test_util.deterministic_ops():
  
          def sleep(x):
              time.sleep(0.1)
              return x
  
          def map_function(x):
              if math_ops.equal(x, 0):
                  return script_ops.py_func(
                      sleep, [x], x.dtype, stateful=False
                  )
              else:
                  return x
  
          dataset = dataset_ops.Dataset.range(100)
          dataset = dataset.map(
              map_function,
              num_parallel_calls=2,
              deterministic=local_determinism,
          )
          opts = options_lib.Options()
          opts.deterministic = global_determinism
          dataset = dataset.with_options(opts)
  
          self.assertDatasetProduces(
              dataset, expected_output=range(100)
          )
  
imports: import os
  import time
  from absl.testing import parameterized
  import numpy
  from tensorflow.python.compat import v2_compat
  from tensorflow.python.data.experimental.ops import batching
  from tensorflow.python.data.experimental.ops import interleave_ops
  from tensorflow.python.data.experimental.ops import testing
  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.ops import readers
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import combinations
  from tensorflow.python.framework import config
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import random_seed
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import cond
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.ops import script_ops
  from tensorflow.python.ops import string_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.platform import test
label_desc: Use image node_id 11 for calling the MakeDeterministicTest obj's underlying member method code with example usage: obj.test_deterministic_attribute(local_determinism, global_determinism) and returns: x, script_ops, x