def set_size(self, size, surface_size):
self.size = size<EOL>self.position = (<NUM_LIT:0>, surface_size[<NUM_LIT:1>] - self.size[<NUM_LIT:1>])<EOL>y = self.position[<NUM_LIT:1>] + self.padding<EOL>max_length = self.max_length<EOL>for row in self.rows:<EOL><INDENT>r = len(row)<EOL>width = (r * self.key_size) + ((r + <NUM_LIT:1>) * self.padding)<EOL>x = (surface_size[<NUM_LIT:0>] - width) / <NUM_LIT:2><EOL>if row.space is not None:<EOL><INDENT>x -= ((row.space.length - <NUM_LIT:1>) * self.key_size) / <NUM_LIT:2><EOL><DEDENT>row.set_size((x, y), self.key_size, self.padding)<EOL>y += self.padding + self.key_size<EOL><DEDENT>
Sets the size of this layout, and updates
        position, and rows accordingly.

        :param size: Size of this layout.
        :param surface_size: Target surface size on which layout will be displayed.