code: def get_event_filter(e):
      def event_filter(_, event):
          if event in e:
              return True
          return False
  
      return event_filter
  
file_path: MONAI/tests/test_handler_tb_stats.py
imports: from __future__ import annotations
  import glob
  import tempfile
  import unittest
  from unittest.mock import MagicMock
  from ignite.engine import Engine, Events
  from parameterized import parameterized
  from monai.handlers import TensorBoardStatsHandler
  from monai.utils import optional_import
label_desc: Use image node_id 1 for calling a global function with example usage: get_event_filter(e) and returns: event_filter, False, True