(path)
return leftmost, idx
Returns the leftmost, topmost point of the path.
Returns the leftmost, topmost point of the path.
Returns the leftmost topmost point of the path .
def _get_leftmost_point(path):
  """Returns the leftmost, topmost point of the path."""
  leftmost = (float('inf'), float('inf'))
  idx = -1

  for i, cmd in enumerate(path):
    if len(cmd) > 1:
      endpoint = cmd[-2:]
      if _is_to_left_of(endpoint, leftmost):
        leftmost = endpoint
        idx = i

  return leftmost, idx
def _get_leftmost_point ( path ) : leftmost = ( float ( 'inf' ) , float ( 'inf' ) ) idx = - 1 for i , cmd in enumerate ( path ) : if len ( cmd ) > 1 : endpoint = cmd [ - 2 : ] if _is_to_left_of ( endpoint , leftmost ) : leftmost = endpoint idx = i return leftmost , idx