code: def escape_and_normalize(log):
      # These logs contain paths like /tmp/tmpgmypg3xa that are inconsistent between
      # builds. This replaces these inconsistent paths with a consistent placeholder
      # so the output is deterministic.
      log = re.sub(r"/tmp/[^ ]+ ", "/NORMALIZED_TMP_FILE_PATH ", log)
      log = re.sub(r"/build/work/[^/]+", "/NORMALIZED_BUILD_PATH", log)
      return html.escape(log, quote=True)
  
imports: import html
  import json
  import re
label_desc: Use image node_id 2 for calling a global function with example usage: escape_and_normalize(log) and returns: html