code: def clean_strokes(sample_strokes, factor=100):
      """Cut irrelevant end points, scale to pixel space and store as integer."""
      # Useful function for exporting data to .json format.
      copy_stroke = []
      added_final = False
      for j in range(len(sample_strokes)):
          finish_flag = int(sample_strokes[j][4])
          if finish_flag == 0:
              copy_stroke.append(
                  [
                      int(round(sample_strokes[j][0] * factor)),
                      int(round(sample_strokes[j][1] * factor)),
                      int(sample_strokes[j][2]),
                      int(sample_strokes[j][3]),
                      finish_flag,
                  ]
              )
          else:
              copy_stroke.append([0, 0, 0, 0, 1])
              added_final = True
              break
      if not added_final:
          copy_stroke.append([0, 0, 0, 0, 1])
      return copy_stroke
  
imports: import random
  import numpy
label_desc: Use image node_id 9 for calling a global function with example usage: clean_strokes(sample_strokes, factor) and returns: copy_stroke