code: def checkpoint_to_pb(chk: Checkpoint) -> pb.Checkpoint:
      return pb.Checkpoint(
          id=chk.id,
          created=timestamp_to_pb(chk.created),
          path=chk.path,
          step=chk.step,
          metrics=value_map_to_pb(chk.metrics),
          primaryMetric=primary_metric_to_pb(chk.primary_metric),
      )
  
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 16 for calling a global function with example usage: checkpoint_to_pb(chk) and returns: pb