code: def test_every(self):
      # 这里是什么样的事件是不影响的，因为我们是与 Trainer 拆分开了进行测试；
      event_state = Event.on_train_begin()  # 什么都不输入是应当默认 every=1；
  
      @Filter(
          every=event_state.every,
          once=event_state.once,
          filter_fn=event_state.filter_fn,
      )
      def _fn(data):
          return data
  
      _res = []
      for i in range(100):
          cu_res = _fn(i)
          if cu_res is not None:
              _res.append(cu_res)
      assert _res == list(range(100))
  
      event_state = Event.on_train_begin(every=10)
  
      @Filter(
          every=event_state.every,
          once=event_state.once,
          filter_fn=event_state.filter_fn,
      )
      def _fn(data):
          return data
  
      _res = []
      for i in range(100):
          cu_res = _fn(i)
          if cu_res is not None:
              _res.append(cu_res)
      assert _res == [w - 1 for w in range(10, 101, 10)]
  
file_path: fastNLP/tests/core/callbacks/test_callback_event.py
imports: import pytest
  from functools import reduce
  from fastNLP.core.callbacks.callback_event import Event, Filter
label_desc: Use image node_id 1 for calling the TestCallbackEvents obj's underlying member method code with example usage: obj.test_every() and returns: data, data