code: def post_process(text: str) -> str:
      lines = text.splitlines()
      # Strip terminal white space on each line.
      lines = [line.rstrip() for line in lines]
      # Delete empty lines at the end of the file.
      while lines and not lines[-1]:
          lines.pop()
      return "\n".join(lines)
  
file_path: determined/tools/scripts/gen-attributions.py
imports: import email
  import os
  import sys
  from typing import IO, List, Optional
label_desc: Use image node_id 2 for calling a global function with example usage: post_process(text) and returns: str