code: def _get_checkpoint_metrics_counts() -> (int, int):
      """Get the count for recorded sync and async checkpoint write durations."""
  
      def get_count(method):
          proto_bytes = method(
              api_label=async_checkpoint._ASYNC_CHECKPOINT_V1
          )
          histogram_proto = summary_pb2.HistogramProto()
          histogram_proto.ParseFromString(proto_bytes)
          return int(histogram_proto.num)
  
      return get_count(metrics.GetCheckpointWriteDurations), get_count(
          metrics.GetAsyncCheckpointWriteDurations
      )
  
imports: import os
  import numpy
  from tensorflow.core.framework import summary_pb2
  from tensorflow.python.compat import v2_compat
  from tensorflow.python.distribute.cluster_resolver import tpu_cluster_resolver
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.lib.io import file_io
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import metrics
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.ops.losses import losses
  from tensorflow.python.platform import flags
  from tensorflow.python.platform import test
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.saved_model.pywrap_saved_model import metrics
  from tensorflow.python.tpu import async_checkpoint
  from tensorflow.python.tpu import tpu_optimizer
  from tensorflow.python.training import basic_session_run_hooks
  from tensorflow.python.training import training
  from tensorflow_estimator.python.estimator import estimator
  from tensorflow_estimator.python.estimator import model_fn
  from tensorflow_estimator.python.estimator.tpu import tpu_config
  from tensorflow_estimator.python.estimator.tpu import tpu_estimator
label_desc: Use image node_id 1 for calling a global function with example usage: _get_checkpoint_metrics_counts() and returns: get_count,  get_count, int