docstr: Get the shared primary metric for this list of checkpoints.
  If no shared primary metric exists, raises ValueError.
docstr_tok: ["Get","the","shared","primary","metric","for","this","list","of","checkpoints",".","If","no","shared","primary","metric","exists",",","raises","ValueError","."]
code: def primary_metric(self) -> str:
      """
      Get the shared primary metric for this list of checkpoints.
      If no shared primary metric exists, raises ValueError.
      """
      primary_metric = None
      for chk in self:
          if chk.primary_metric is None:
              continue
  
          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 this experiments"
              )
          primary_metric = pm
  
      if primary_metric is None:
          raise ValueError(
              "No primary metric is defined for the checkpoints in theis experiment"
          )
  
      return primary_metric
  
imports: import datetime
  import os
  import io
  import tempfile
  import json
  import sys
  import html
  from typing import Optional, Dict, Any, List, BinaryIO, TYPE_CHECKING, MutableSequence
  from .None import console
  from .json import CustomJSONEncoder
  from .metadata import rfc3339_datetime, parse_rfc3339
  from .validate import check_path
label_desc: Use image node_id 1 for calling the CheckpointList obj's underlying member method code with example usage: obj.primary_metric() and returns: primary_metric