code: def _set_or_check_remote_id(self, remote_id):
      
      if not self.remote_id:
        assert self.closed_state == self.ClosedState.PENDING, 'Bad ClosedState!'
        self.remote_id = remote_id
        self.closed_state = self.ClosedState.OPEN
      elif self.remote_id != remote_id:
        raise usb_exceptions.AdbProtocolError(
            '%s remote-id change to %s', self, remote_id)
docs: Set or check the remote id.