code: def get_step_from_checkpoint_path(checkpoint_path):
      """Returns the global step for the checkpoint at `checkpoint_path`.
  
      **Note**: This function works for checkpoints that are saved in the TF format
      only.
  
      Assumes `checkpoint_path` corresponds to a file which contains the substring
      model.ckpt-{global_step}
  
      Args:
        checkpoint_path: str of path to a checkpoint file.
  
      Returns:
        int of the global step corresponding to the checkpoint file.
  
      Raises:
        ValueError if checkpoint_path does not correspond to a model checkpoint file
        which contains the global_step in its filename.
      """
      match = re.match(r".*model\.ckpt\-(\d+).*", checkpoint_path)
      if match is None:
          raise ValueError(
              "Invalid checkpoint path {}".format(checkpoint_path)
          )
      return int(match.group(1))
  
imports: import functools
  import os
  import re
  from typing import Any, Callable, Iterable, Mapping, MutableSequence, Optional, Sequence, Tuple, Union
  from absl import logging
  import gin
  import numpy
  import seqio
  import t5.data
  import tensorflow.compat.v1
  import tensorflow_datasets
  import typing_extensions
label_desc: Use image node_id 3 for calling a global function with example usage: get_step_from_checkpoint_path(checkpoint_path) and returns: int