code: def get_latest_file(
      dir_path, prefix="operative_config-", suffix=".gin"
  ):
      """Returns latest file with pattern '/dir_path/prefix[iteration]suffix'.
  
      Args:
        dir_path: Path to the directory.
        prefix: Filename prefix, not including directory.
        suffix: Filename suffix, including extension.
  
      Returns:
        Path to the latest file
  
      Raises:
        FileNotFoundError: If no files match the pattern
          '/dir_path/prefix[int]suffix'.
      """
      dir_path = expand_path(dir_path)
      dir_prefix = os.path.join(dir_path, prefix)
      search_pattern = dir_prefix + "*" + suffix
      file_paths = tf.io.gfile.glob(search_pattern)
      if not file_paths:
          raise FileNotFoundError(
              f"No files found matching the pattern '{search_pattern}'."
          )
      try:
          # Filter to get highest iteration, no negative iterations.
          get_iter = lambda fp: abs(
              int(fp.split(dir_prefix)[-1].split(suffix)[0])
          )
          latest_file = max(file_paths, key=get_iter)
          return latest_file
      except ValueError as verror:
          raise FileNotFoundError(
              f"Files found with pattern '{search_pattern}' do not match "
              f"the pattern '{dir_prefix}[iteration_number]{suffix}'.\n\n"
              f"Files found:\n{file_paths}"
          ) from verror
  
file_path: ddsp/ddsp/training/train_util.py
imports: import json
  import os
  import time
  from absl import logging
  from ddsp.training import cloud
  import gin
  import tensorflow.compat.v2
label_desc: Use image node_id 3 for calling a global function with example usage: get_latest_file(dir_path, prefix, suffix) and returns: latest_file