<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def change_state(self, state):
 """Change the state of the remote process, logging the change"""

        if state is not self.state:
            if self.debug:
                self.print_debug(b'state => ' + STATE_NAMES[state].encode())
            if self.state is STATE_NOT_STARTED:
                self.read_in_state_not_started = b''
            self.state = state