code: def write_csv(data, output):
      """
      Write csv data
  
      Args:
          output (str): output file path
          data (list(str)):
              the csv formatted data
      """
      output_path = output[:-3] + "csv"
      with open(output_path, "w", encoding="utf-8") as out_file:
          writer = csv.writer(out_file, delimiter=",", quotechar='"')
          print("CSV file is saved in {0}".format(output_path))
          for result_row in data:
              writer.writerow(result_row)
  
file_path: nlp-architect/examples/np_semantic_segmentation/preprocess_tratz2011.py
imports: from __future__ import unicode_literals, print_function, division, absolute_import
  import argparse
  import csv
  import os
  from .data import absolute_path
  from nlp_architect.utils.io import validate_existing_directory
label_desc: Use image node_id 3 for calling a global function with example usage: write_csv(data, output) without return types