class_docstr: An object which handles communicating with metadata db through MLMD.
class_docstr_tok: ["An","object","which","handles","communicating","with","metadata","db","through","MLMD","."]
docstr: Returns a Trial object like object.
docstr_tok: ["Returns","a","Trial","object","like","object","."]
code: def _convert_to_trial_object(self, trial_str):
      """Returns a Trial object like object."""
      evaluation_dictionary = json.loads(
          trial_str.properties["evaluation"].string_value
      )
      data_as_json = {
          "id": trial_str.properties["id"].int_value,
          "status": trial_str.properties["state"].string_value,
          "final_measurement": {
              "objective_value": evaluation_dictionary[
                  self._optimization_metric
              ]
          },
          "model_dir": trial_str.properties["model_dir"].string_value,
          "trial_infeasible": False,
      }
      return trial.Trial(data_as_json)
  
file_path: model_search/model_search/metadata/ml_metadata_db.py
imports: import json
  import os
  import random
  from absl import flags
  from absl import logging
  from model_search.metadata import metadata
  from model_search.metadata import trial
  from ml_metadata import metadata_store
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 4 for calling the MLMetaData obj's underlying member method code with example usage: obj._convert_to_trial_object(trial_str) and returns: trial