def setState(self, state):
    if isinstance(state, int):
        self._lastEventId = state
    elif isinstance(state, tuple):
        (self._lastEventId, self._backlog) = state
    else:
        raise ValueError(('Unknown state type: %s.' % type(state)))
def setState(self, state):
    if isinstance(state, int):
        self._lastEventId = state
    elif isinstance(state, tuple):
        (self._lastEventId, self._backlog) = state
    else:
        raise ValueError(('Unknown state type: %s.' % type(state)))