class_docstr: Abstract class whose subclasses implement strategies for model
  selection across hparams and timesteps.
class_docstr_tok: ["Abstract","class","whose","subclasses","implement","strategies","for","model","selection","across","hparams","and","timesteps","."]
docstr: Given all records from a single (dataset, algorithm, test env) pair,
  return a sorted list of (run_acc, records) tuples.
docstr_tok: ["Given","all","records","from","a","single","(","dataset",",","algorithm",",","test","env",")","pair",",","return","a","sorted","list","of","(","run_acc",",","records",")","tuples","."]
code: def hparams_accs(self, records):
      """
      Given all records from a single (dataset, algorithm, test env) pair,
      return a sorted list of (run_acc, records) tuples.
      """
      return (
          records.group("args.hparams_seed")
          .map(
              lambda _, run_records: (
                  self.run_acc(run_records),
                  run_records,
              )
          )
          .filter(lambda x: x[0] is not None)
          .sorted(key=lambda x: x[0]["val_acc"])[::-1]
      )
  
file_path: generalized-moe/domainbed/model_selection.py
imports: import itertools
  import numpy
label_desc: Use image node_id 3 for calling the SelectionMethod obj's underlying member method code with example usage: obj.hparams_accs(records) and returns: records