code: def save_result(result_path, box_list, score_list, is_output_polygon):
      if is_output_polygon:
          with open(result_path, "wt") as res:
              for i, box in enumerate(box_list):
                  box = box.reshape(-1).tolist()
                  result = ",".join([str(int(x)) for x in box])
                  score = score_list[i]
                  res.write(result + "," + str(score) + "\n")
      else:
          with open(result_path, "wt") as res:
              for i, box in enumerate(box_list):
                  score = score_list[i]
                  box = box.reshape(-1).tolist()
                  result = ",".join([str(int(x)) for x in box])
                  res.write(result + "," + str(score) + "\n")
  
imports: import json
  import pathlib
  import time
  import os
  import glob
  import cv2
  import yaml
  from typing import Mapping
  import matplotlib.pyplot
  import numpy
  from argparse import ArgumentParser, RawDescriptionHelpFormatter
label_desc: Use image node_id 17 for calling a global function with example usage: save_result(result_path, box_list, score_list, is_output_polygon) without return types