code: def testSerializeDeserializeLegacyEvalConfig(self):
      output_path = self._getTempDir()
      old_config = LegacyConfig(
          model_location="/path/to/model",
          data_location="/path/to/data",
          slice_spec=[
              slicer.SingleSliceSpec(
                  columns=["country"],
                  features=[("age", 5), ("gender", "f")],
              ),
              slicer.SingleSliceSpec(
                  columns=["interest"],
                  features=[("age", 6), ("gender", "m")],
              ),
          ],
          example_count_metric_key=None,
          example_weight_metric_key="key",
          compute_confidence_intervals=False,
          k_anonymization_count=1,
      )
      final_dict = {}
      final_dict["tfma_version"] = tfma_version.VERSION
      final_dict["eval_config"] = old_config
      with tf.io.TFRecordWriter(
          os.path.join(output_path, "eval_config")
      ) as w:
          w.write(pickle.dumps(final_dict))
      (
          got_eval_config,
          got_data_location,
          _,
          got_model_locations,
      ) = eval_config_writer.load_eval_run(output_path)
      options = config_pb2.Options()
      options.compute_confidence_intervals.value = (
          old_config.compute_confidence_intervals
      )
      options.min_slice_size.value = old_config.k_anonymization_count
      eval_config = config_pb2.EvalConfig(
          slicing_specs=[
              config_pb2.SlicingSpec(
                  feature_keys=["country"],
                  feature_values={"age": "5", "gender": "f"},
              ),
              config_pb2.SlicingSpec(
                  feature_keys=["interest"],
                  feature_values={"age": "6", "gender": "m"},
              ),
          ],
          options=options,
      )
      self.assertEqual(eval_config, got_eval_config)
      self.assertEqual(old_config.data_location, got_data_location)
      self.assertLen(got_model_locations, 1)
      self.assertEqual(
          old_config.model_location,
          list(got_model_locations.values())[0],
      )
  
file_path: model-analysis/tensorflow_model_analysis/writers/eval_config_writer_test.py
imports: import os
  import pickle
  from typing import Dict, List, NamedTuple, Optional, Union
  import tensorflow
  from tensorflow_model_analysis import version
  from tensorflow_model_analysis.eval_saved_model import testutil
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.slicer import slicer_lib
  from tensorflow_model_analysis.writers import eval_config_writer
label_desc: Use image node_id 1 for calling the EvalConfigWriterTest obj's underlying member method code with example usage: obj.testSerializeDeserializeLegacyEvalConfig() without return types