code: def test_write_replay_spec(self):
      original_spec = phoenix_spec_pb2.PhoenixSpec()
      text_format.Parse(
          """
        minimum_depth: 2
        maximum_depth: 20
        problem_type: CNN
        search_type: ADAPTIVE_COORDINATE_DESCENT
        user_suggestions {
          architecture: "LSTM_128"
        }
      """,
          original_spec,
      )
  
      _write_dependency_reply(self.get_temp_dir())
      trial_utils.write_replay_spec(
          model_dir=self.get_temp_dir(),
          filename="replay_config.pbtxt",
          original_spec=original_spec,
          search_architecture=["RNN_128", "RNN_128"],
          hparams=hp.HParams(
              learning_rate=0.001,
              initial_architecture=["not_cor_arc", "not_cor_arc2"],
              context="should_be_deleted",
          ),
      )
  
      output_spec = phoenix_spec_pb2.PhoenixSpec()
      with tf.io.gfile.GFile(
          self.get_temp_dir() + "/replay_config.pbtxt", "r"
      ) as f:
          text_format.Parse(f.read(), output_spec)
  
      expected_spec = phoenix_spec_pb2.PhoenixSpec()
      text_format.Parse(
          """
        minimum_depth: 2
        maximum_depth: 20
        problem_type: CNN
        search_type: ADAPTIVE_COORDINATE_DESCENT
        replay {
          towers {
            architecture: "RNN_128"
            architecture: "RNN_128"
            hparams {
              hparam {
                key: "learning_rate"
                value {
                  float_value: 0.021
                }
              }
              hparam {
                key: "initial_architecture"
                value {
                  bytes_list {
                    value: "RNN_256"
                    value: "RNN_128"
                  }
                }
              }
            }
          }
          towers {
            architecture: "RNN_128"
            architecture: "RNN_128"
            hparams {
              hparam {
                key: "learning_rate"
                value {
                  float_value: 0.001
                }
              }
              hparam {
                key: "initial_architecture"
                value {
                  bytes_list {
                    value: "RNN_128"
                    value: "RNN_128"
                  }
                }
              }
            }
          }
        }
      """,
          expected_spec,
      )
      self.assertEqual(output_spec, expected_spec)
  
imports: import functools
  import os
  from absl.testing import absltest
  from absl.testing import parameterized
  import mock
  from model_search import hparam
  from model_search.architecture import architecture_utils
  from model_search.generators import trial_utils
  from model_search.proto import distillation_spec_pb2
  from model_search.proto import ensembling_spec_pb2
  from model_search.proto import phoenix_spec_pb2
  import tensorflow.compat.v2
  from google.protobuf import text_format
label_desc: Use image node_id 5 for calling the TrialUtilsTest obj's underlying member method code with example usage: obj.test_write_replay_spec() without return types