code: def validate_term(func):
      
  
      @functools.wraps(func)
      def on_receive_function(self, data):
          if self.storage.term < data['term']:
              self.storage.update({
                  'term': data['term']
              })
              if not isinstance(self, Follower):
                  self.state.to_follower()
  
          if self.storage.term > data['term'] and not data['type'].endswith('_response'):
              response = {
                  'type': '{}_response'.format(data['type']),
                  'term': self.storage.term,
                  'success': False
              }
              asyncio.ensure_future(self.state.send(response, data['sender']), loop=self.loop)
              return
  
          return func(self, data)
      return on_receive_function
docs: Compares current term and request term:
          if current term is stale:
              update current term & become follower
          if received term is stale:
              respond with False