<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def invalidate(self):
 """ Rests all keys states. """

        for row in self.rows:
            for key in row.keys:
                key.state = 0