code: def write_csv(header, contents, sep=",", filename="stdout", thousands=False,
                tee=False, align=True, comment=False):
      
      from jcvi.formats.base import must_open
  
      formatted = load_csv(header, contents,
                           sep=sep, thousands=thousands, align=align)
      if comment:
          formatted[0] = '#' + formatted[0][1:]
      formatted = "\n".join(formatted)
      fw = must_open(filename, "w")
      print(formatted, file=fw)
      if tee and filename != "stdout":
          print(formatted)
docs: Write csv that are aligned with the column headers.
  
      >>> header = ["x_value", "y_value"]
      >>> contents = [(1, 100), (2, 200)]
      >>> write_csv(header, contents)
      x_value, y_value
            1,     100
            2,     200