code: def _check_warnings(raw, events, picks=None, count=3):
      """Count warnings."""
      with _record_warnings() as w:
          Epochs(
              raw,
              events,
              dict(aud_l=1, vis_l=3),
              -0.2,
              0.5,
              picks=picks,
              preload=True,
              proj=True,
          )
      assert len(w) == count
      assert all("dangerous" in str(ww.message) for ww in w)
  
imports: import copy
  from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_equal
  from scipy import linalg
  from mne import Epochs, compute_proj_epochs, compute_proj_evoked, compute_proj_raw, compute_raw_covariance, convert_forward_solution, create_info, pick_types, read_events, read_forward_solution, read_source_estimate, sensitivity_map
  from mne._fiff.proj import _EEG_AVREF_PICK_DICT, _needs_eeg_average_ref_proj, activate_proj, make_projector, setup_proj
  from mne.cov import compute_whitener, regularize
  from mne.datasets import testing
  from mne.io import RawArray, read_raw_fif
  from mne.preprocessing import maxwell_filter
  from mne.proj import _has_eeg_average_ref_proj, make_eeg_average_ref_proj, read_proj, write_proj
  from mne.rank import _compute_rank_int
  from mne.utils import _record_warnings
label_desc: Use image node_id 2 for calling a global function with example usage: _check_warnings(raw, events, picks, count) without return types