def on_receive_append_entries(self, data):
        """If we discover a Leader with the same term — step down"""
        if self.storage.term == data['term']:
            self.state.to_follower()
def on_receive_append_entries ( self , data ) : if self . storage . term == data [ 'term' ] : self . state . to_follower ( )
If we discover a Leader with the same term — step down