code: def testOptimizerToggleOption(self, field):
      # TODO(b/128531235): Improve testing of option
      options = config.get_optimizer_experimental_options()
      self.assertIsNone(options.get(field))
  
      config.set_optimizer_experimental_options({field: True})
      options[field] = True
      self.assertDictEqual(
          config.get_optimizer_experimental_options(), options
      )
      self.assertDictEqual(
          context.context().get_optimizer_experimental_options(),
          options,
      )
  
      config.set_optimizer_experimental_options({field: False})
      options[field] = False
      self.assertDictEqual(
          config.get_optimizer_experimental_options(), options
      )
      self.assertDictEqual(
          context.context().get_optimizer_experimental_options(),
          options,
      )
  
imports: from absl.testing import parameterized
  from tensorflow.core.protobuf import cluster_pb2
  from tensorflow.core.protobuf import config_pb2
  from tensorflow.core.protobuf import rewriter_config_pb2
  from tensorflow.core.protobuf import tensorflow_server_pb2
  from tensorflow.python.eager import context
  from tensorflow.python.eager import def_function
  from tensorflow.python.framework import config
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.platform import test
  from tensorflow.python.util import compat
label_desc: Use image node_id 10 for calling the ConfigTest obj's underlying member method code with example usage: obj.testOptimizerToggleOption(field) without return types