docstr: Get the shared primary metric for all experiments in this list
  of experiments. If no shared primary metric exists, raises
  ValueError.
docstr_tok: ["Get","the","shared","primary","metric","for","all","experiments","in","this","list","of","experiments",".","If","no","shared","primary","metric","exists",",","raises","ValueError","."]
code: def primary_metric(self) -> str:
      """
      Get the shared primary metric for all experiments in this list
      of experiments. If no shared primary metric exists, raises
      ValueError.
      """
      primary_metric = None
      for exp in self:
          for chk in exp.checkpoints:
              pm = chk.primary_metric["name"]
              if pm is None:
                  continue
              if primary_metric is not None and primary_metric != pm:
                  raise ValueError(
                      "The primary metric differs between the checkpoints in these experiments"
                  )
              primary_metric = pm
      if primary_metric is None:
          raise ValueError(
              "No primary metric is defined for the checkpoints in these experiments"
          )
  
      return primary_metric
  
imports: import datetime
  import getpass
  import html
  import json
  import math
  import os
  import shlex
  import sys
  from typing import TYPE_CHECKING, Any, Callable, Dict, List, MutableSequence, Optional, Tuple
  from .None import console
  from .checkpoint import Checkpoint, CheckpointList, PrimaryMetric
  from .metadata import parse_rfc3339, rfc3339_datetime
  from .packages import get_imported_packages
  from .system import get_python_version
  from .validate import check_path
  from .version import version
label_desc: Use image node_id 1 for calling the ExperimentList obj's underlying member method code with example usage: obj.primary_metric() and returns: primary_metric