code: def write_support_file(mon, log_file="paramlog.py", **kwds):
      """write parameter and solution trajectory to a log file in 'support' format
  
      mon is a monitor; log_file is a str log file path, with format:
  
      # header
      id = ...
      params = ...
      cost = ...
  
      `id` is a tuple of (iteration, id), with `id` an int or None
      `params` is a list[float], and is the input to the cost function
      `cost` is a float or tuple[float], and is the output of the cost function
  
      if header is provided, then the given string is written as the file header
      all other kwds are written as file entries
  
      NOTE: params are the transpose of how they are stored in monitor.x
      """
      if isNull(mon):
          return  # XXX: throw error? warning? ???
      monitor = write_monitor(*raw_to_support(*read_monitor(mon)))
      monitor._id = mon._id[:]  # HACK: workaround loss of id above
      monitor.k = (
          mon.k
      )  # HACK: workaround loss of k above (ensure is copy?)
      header = "written in 'support' format"
      if "header" in kwds:
          header += "\n# " + str(kwds["header"])
          del kwds["header"]
      write_raw_file(monitor, log_file, header=header, **kwds)
      return
  
imports: from mystic.tools import list_or_tuple_or_ndarray
  from mystic.tools import isNull
  import sys
label_desc: Use image node_id 12 for calling a global function with example usage: write_support_file(mon, log_file) without return types