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","."]
code: def get_best_k(self, trials=None, k=1, valid_only=False):
      trials_ = (
          trials if trials is not None else self.get_completed_trials()
      )
      return trial.get_best_k(
          trials=trials_,
          k=k,
          status_whitelist=["COMPLETED"],
          optimization_goal=self._optimization_goal,
      )
  
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 8 for calling the MLMetaData obj's underlying member method code with example usage: obj.get_best_k(trials, k, valid_only) and returns: trial