def __init__(self, pattern):
self._pattern = pattern<EOL>self._rows = list(pattern.rows)<EOL>self._walk = _RecursiveWalk(self._rows[<NUM_LIT:0>].instructions[<NUM_LIT:0>])<EOL>self._rows.sort(key=lambda row: self._walk.row_in_grid(row).yx)<EOL>
:param knittingpattern.KnittingPattern.KnittingPattern pattern: the
  pattern to layout