code: def _event_files_digest(dir):
      """Returns a digest for dir that changes when events change.
  
      The digest includes the list of event logs and their associated
      sizes.
      """
      event_files = sorted(glob.glob(os.path.join(dir, "*.tfevents.*")))
      to_hash = "\n".join(
          [
              f"{filename}\n{os.path.getsize(filename)}"
              for filename in event_files
              if os.path.isfile(filename)
          ]
      )
      return hashlib.md5(to_hash.encode("utf-8")).hexdigest()
  
imports: import glob
  import hashlib
  import logging
  import os
  from guild import tensorboard_util
label_desc: Use image node_id 10 for calling a global function with example usage: _event_files_digest(dir) and returns: hashlib