code: def test_low_rank_methods(rank, raw_epochs_events):
      """Test low-rank covariance matrix estimation."""
      pytest.importorskip("sklearn")
      epochs = raw_epochs_events[1]
      sss_proj_rank = 139  # 80 MEG + 60 EEG - 1 proj
      n_ch = 366
      methods = ("empirical", "diagonal_fixed", "oas")
      bounds = {
          "None": dict(
              empirical=(-15000, -5000),
              diagonal_fixed=(-1500, -500),
              oas=(-700, -600),
          ),
          "full": dict(
              empirical=(-18000, -8000),
              diagonal_fixed=(-2000, -1600),
              oas=(-1600, -1000),
          ),
          "info": dict(
              empirical=(-15000, -5000),
              diagonal_fixed=(-700, -600),
              oas=(-700, -600),
          ),
      }
      with pytest.warns(RuntimeWarning, match="Too few samples"):
          covs = compute_covariance(
              epochs,
              method=methods,
              return_estimators=True,
              rank=rank,
              verbose=True,
          )
      for cov in covs:
          method = cov["method"]
          these_bounds = bounds[str(rank)][method]
          this_rank = _cov_rank(cov, epochs.info, proj=(rank != "full"))
          if rank == "full" and method != "empirical":
              assert this_rank == n_ch
          else:
              assert this_rank == sss_proj_rank
          assert these_bounds[0] < cov["loglik"] < these_bounds[1], (
              rank,
              method,
          )
  
imports: import itertools
  import sys
  from inspect import signature
  from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_almost_equal, assert_array_equal, assert_equal
  from mne import Epochs, compute_covariance, compute_proj_raw, compute_rank, compute_raw_covariance, create_info, find_events, make_ad_hoc_cov, make_fixed_length_events, merge_events, pick_channels_cov, pick_info, pick_types, read_cov, read_evokeds, write_cov
  from mne._fiff.pick import _DATA_CH_TYPES_SPLIT
  from mne.channels import equalize_channels
  from mne.cov import _auto_low_rank_model, _regularized_covariance, compute_whitener, prepare_noise_cov, regularize, whiten_evoked
  from mne.datasets import testing
  from mne.fixes import _safe_svd
  from mne.io import RawArray, read_info, read_raw_ctf, read_raw_fif
  from mne.preprocessing import maxwell_filter
  from mne.rank import _compute_rank_int
  from mne.utils import _record_warnings, assert_snr, catch_logging
label_desc: Use image node_id 19 for calling a global function with example usage: test_low_rank_methods(rank, raw_epochs_events) without return types