code: def _make_clockwise(subpath):
      """Inverts the cardinality of the given subpath."""
      new_path = [subpath[0]]
      other_cmds = list(reversed(subpath[1:]))
      for i, cmd in enumerate(other_cmds):
          if i + 1 == len(other_cmds):
              where_we_were = subpath[0][-2:]
          else:
              where_we_were = other_cmds[i + 1][-2:]
  
          if len(cmd) > 3:
              new_cmd = [
                  cmd[0],
                  cmd[3],
                  cmd[4],
                  cmd[1],
                  cmd[2],
                  where_we_were[0],
                  where_we_were[1],
              ]
          else:
              new_cmd = [cmd[0], where_we_were[0], where_we_were[1]]
  
          new_path.append(new_cmd)
      return new_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 17 for calling a global function with example usage: _make_clockwise(subpath) and returns: new_path