<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def accept_line(self, logevent):
 """ Return True on match. Only match log lines containing 'is now in state' (reflects other node's state changes) or of type "[rsMgr] replSet PRIMARY" (reflects own state changes). """

        if ("is now in state" in logevent.line_str and
                logevent.split_tokens[-1] in self.states):
            return True

        if ("replSet" in logevent.line_str and
                logevent.thread == "rsMgr" and
                logevent.split_tokens[-1] in self.states):
            return True

        return False