code: def checkpoint_from_pb(
      experiment: Experiment, chk_pb: pb.Checkpoint
  ) -> Checkpoint:
      chk = Checkpoint(
          id=chk_pb.id,
          created=timestamp_from_pb(chk_pb.created),
          path=noneable(chk_pb.path),
          step=chk_pb.step,
          metrics=value_map_from_pb(chk_pb.metrics),
          primary_metric=primary_metric_from_pb(chk_pb.primaryMetric),
      )
      chk._experiment = experiment
      return chk
  
imports: import datetime
  import json
  from typing import List, Dict, Any, Optional, MutableMapping
  from google.protobuf import timestamp_pb2
  from .servicepb import keepsake_pb2
  from .experiment import Experiment
  from .checkpoint import Checkpoint, PrimaryMetric, CheckpointList
label_desc: Use image node_id 5 for calling a global function with example usage: checkpoint_from_pb(experiment, chk_pb) and returns: chk