<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_key_state(self, key, state):
 """Sets the key state and redraws it. :param key: Key to update state for. :param state: New key state. """

        key.state = state
        self.renderer.draw_key(self.surface, key)