class_docstr: Like Selection method which picks argmax(test_out_acc) across all hparams
  and checkpoints, but instead of taking the argmax over all
  checkpoints, we pick the last checkpoint, i.e. no early stopping.
class_docstr_tok: ["Like","Selection","method","which","picks","argmax","(","test_out_acc",")","across","all","hparams","and","checkpoints",",","but","instead","of","taking","the","argmax","over","all","checkpoints",",","we","pick","the","last","checkpoint",",","i.e",".","no","early","stopping","."]
code: def run_acc(self, run_records):
      run_records = run_records.filter(
          lambda r: len(r["args"]["test_envs"]) == 1
      )
      if not len(run_records):
          return None
      test_env = run_records[0]["args"]["test_envs"][0]
      test_out_acc_key = "env{}_out_acc".format(test_env)
      test_in_acc_key = "env{}_in_acc".format(test_env)
      chosen_record = run_records.sorted(lambda r: r["step"])[-1]
      return {
          "val_acc": chosen_record[test_out_acc_key],
          "test_acc": chosen_record[test_in_acc_key],
      }
  
file_path: generalized-moe/domainbed/model_selection.py
imports: import itertools
  import numpy
label_desc: Use image node_id 1 for calling the OracleSelectionMethod obj's underlying member method code with example usage: obj.run_acc(run_records) and returns: dict, None