(subpath)
return new_path
Inverts the cardinality of the given subpath.
Inverts the cardinality of the given subpath.
Inverts the cardinality of the given subpath .
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
def _make_clockwise ( 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