code: def write_results(predictions, output):
      """
      Write csv file of predication results to specified --output
  
      Args:
          output (str): output file path
          predictions:
              the model's predictions
      """
      results_list = [round(p[0]) for p in predictions.tolist()]
      with open(output, "w", encoding="utf-8") as out_file:
          writer = csv.writer(out_file, delimiter=",", quotechar='"')
          for result in results_list:
              writer.writerow([result])
      print("Results of inference saved in {0}".format(output))
  
file_path: nlp-architect/examples/np_semantic_segmentation/inference.py
imports: import argparse
  import csv
  import os
  from .data import NpSemanticSegData, absolute_path
  from nlp_architect.models.np_semantic_segmentation import NpSemanticSegClassifier
  from nlp_architect.utils.io import validate_existing_filepath, validate_parent_exists
label_desc: Use image node_id 3 for calling a global function with example usage: write_results(predictions, output) without return types