code: def castrate_file(path, st):
      #  Remove junk contents from an output file after a
      #  failed compilation.
      #  Also sets access and modification times back to
      #  those specified by st (a stat struct).
      try:
          f = open_new_file(path)
      except EnvironmentError:
          pass
      else:
          f.write(
              "#error Do not use this file, it is the result of a failed Cython compilation.\n"
          )
          f.close()
          if st:
              os.utime(path, (st.st_atime, st.st_mtime - 1))
  
imports: from __future__ import absolute_import
  import os
  import sys
  import re
  import io
  import codecs
  import shutil
  import tempfile
  from contextlib import contextmanager
label_desc: Use image node_id 6 for calling a global function with example usage: castrate_file(path, st) without return types