code: def lines_to_strokes(lines):
      """Convert polyline format to stroke-3 format."""
      eos = 0
      strokes = [[0, 0, 0]]
      for line in lines:
          linelen = len(line)
          for i in range(linelen):
              eos = 0 if i < linelen - 1 else 1
              strokes.append([line[i][0], line[i][1], eos])
      strokes = np.array(strokes)
      strokes[1:, 0:2] -= strokes[:-1, 0:2]
      return strokes[1:, :]
  
imports: import random
  import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: lines_to_strokes(lines) and returns: strokes