code: def test_how_to_deal_with_warnings():
      """Test filter some messages out of warning records."""
      with pytest.warns(UserWarning, match="bb") as w:
          warnings.warn("aa warning", UserWarning)
          warnings.warn("bb warning", UserWarning)
          warnings.warn("bb warning", RuntimeWarning)
          warnings.warn("aa warning", UserWarning)
      filter_out_warnings(w, category=UserWarning, match="aa")
      filter_out_warnings(w, category=RuntimeWarning)
      assert len(w) == 1
  
imports: import logging
  import os
  import re
  import warnings
  from pathlib import Path
  import numpy
  import pytest
  from mne import Epochs, create_info, read_evokeds
  from mne.io import RawArray, read_raw_fif
  from mne.parallel import parallel_func
  from mne.utils import _get_call_line, catch_logging, check, filter_out_warnings, logger, set_log_file, set_log_level, use_log_level, verbose, warn
  from mne.utils._logging import _frame_info
label_desc: Use image node_id 3 for calling a global function with example usage: test_how_to_deal_with_warnings() without return types