code: def test_get_completed_trials(self):
      connection_config = metadata_store_pb2.ConnectionConfig()
      connection_config.sqlite.filename_uri = os.path.join(
          FLAGS.test_tmpdir, "3"
      )
      connection_config.sqlite.connection_mode = 3
      handler = ml_metadata_db.MLMetaData(
          None, None, None, connection_config=connection_config
      )
      handler.before_generating_trial_model(
          trial_id=1, model_dir="/tmp/1"
      )
      handler.before_generating_trial_model(
          trial_id=2, model_dir="/tmp/2"
      )
      handler.report(eval_dictionary={"loss": 0.1}, model_dir="/tmp/1")
      handler.before_generating_trial_model(
          trial_id=3, model_dir="/tmp/3"
      )
      handler.report(eval_dictionary={"loss": 0.3}, model_dir="/tmp/3")
      handler.report(eval_dictionary={"loss": 0.2}, model_dir="/tmp/2")
      output = handler.get_completed_trials()
      self.assertLen(output, 3)
      for i in range(3):
          self.assertEqual(output[i].status, "COMPLETED")
          self.assertEqual(
              output[i].model_dir, "/tmp/" + str(output[i].id)
          )
          self.assertEqual(
              output[i].final_measurement.objective_value,
              float(output[i].id) / 10,
          )
  
file_path: model_search/model_search/metadata/ml_metadata_db_test.py
imports: import os
  from absl import flags
  from absl.testing import absltest
  from model_search.metadata import ml_metadata_db
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 3 for calling the MlMetadataTest obj's underlying member method code with example usage: obj.test_get_completed_trials() without return types