code: def find_event_log(
      eventlog_dir: str, log_file_pattern: str = "events.out.tfevents.*"
  ) -> str:
      """Find the event log in a given folder.
  
      Expects to find a single log file matching the pattern provided.
  
      Args:
        eventlog_dir: Event log directory to search.
        log_file_pattern: Pattern to use to find the event log.
  
      Returns:
        Path to the event log file that was found.
  
      Raises:
        FileNotFoundError: If an event log is not found in the event log
          directory.
      """
      event_log_path = os.path.join(eventlog_dir, log_file_pattern)
  
      # In OSS tf.io.gfile.glob throws `NotFoundError` vs returning an empty
      # list. Catching `NotFoundError` and doing the check yields a consistent
      # message.
      try:
          event_files = tf.io.gfile.glob(event_log_path)
      except tf.errors.NotFoundError:
          event_files = []
  
      if not event_files:
          raise FileNotFoundError(
              f"No files found matching pattern:{event_log_path}"
          )
  
      assert (
          len(event_files) == 1
      ), 'Found {} event files({}) matching "{}" pattern and expected 1.'.format(
          len(event_files), ",".join(event_files), event_log_path
      )
  
      return event_files[0]
  
imports: import datetime
  import os
  import time
  from typing import Dict, Optional, Tuple
  from absl import logging
  import numpy
  from six.moves import range
  from six.moves import zip
  import tensorflow
  from tensorflow.core.util import event_pb2
  from tensorflow.python.lib.io import tf_record
label_desc: Use image node_id 7 for calling a global function with example usage: find_event_log(eventlog_dir, log_file_pattern) and returns: event_files