code: def csv_dict_writer(f, fieldnames, **kwargs):
      """Equivalent of csv.DictWriter, but allows `delimiter` to be a unicode string on Py2."""
      import csv
  
      if "delimiter" in kwargs:
          kwargs["delimiter"] = str(kwargs["delimiter"])
      return csv.DictWriter(f, fieldnames, **kwargs)
  
file_path: h2o-3/h2o-py/h2o/utils/compatibility.py
label_desc: Use image node_id 2 for calling a global function with example usage: csv_dict_writer(f, fieldnames) and returns: csv