code: def _update_curr_pos(curr_pos, cmd, start_of_path):
      """Calculate the position of the pen after cmd is applied."""
      if cmd[0] in "ml":
          curr_pos = [
              curr_pos[0] + float(cmd[1]),
              curr_pos[1] + float(cmd[2]),
          ]
          if cmd[0] == "m":
              start_of_path = curr_pos
      elif cmd[0] in "z":
          curr_pos = start_of_path
      elif cmd[0] in "h":
          curr_pos = [curr_pos[0] + float(cmd[1]), curr_pos[1]]
      elif cmd[0] in "v":
          curr_pos = [curr_pos[0], curr_pos[1] + float(cmd[1])]
      elif cmd[0] in "ctsqa":
          curr_pos = [
              curr_pos[0] + float(cmd[-2]),
              curr_pos[1] + float(cmd[-1]),
          ]
  
      return curr_pos, start_of_path
  
imports: import io
  import numpy
  from PIL import Image
  from six.moves import zip_longest
  from skimage import draw
  import tensorflow.compat.v1
label_desc: Use image node_id 11 for calling a global function with example usage: _update_curr_pos(curr_pos, cmd, start_of_path) and returns: curr_pos,  start_of_path