code: def write_file(filename, contents):
      """Create a file with the specified name and write 'contents' (a
      sequence of strings without line terminators) to it.
      """
      f = open(filename, "w")
      try:
          for line in contents:
              f.write(line + "\n")
      finally:
          f.close()
  
imports: import os
  from .errors import DistutilsFileError
  from ._log import log
label_desc: Use image node_id 4 for calling a global function with example usage: write_file(filename, contents) without return types