code: def test_auto_low_rank():
      """Test probabilistic low rank estimators."""
      pytest.importorskip("sklearn")
      n_samples, n_features, rank = 400, 10, 5
      sigma = 0.1
  
      def get_data(n_samples, n_features, rank, sigma):
          rng = np.random.RandomState(42)
          W = rng.randn(n_features, n_features)
          X = rng.randn(n_samples, rank)
          U, _, _ = _safe_svd(W.copy())
          X = np.dot(X, U[:, :rank].T)
  
          sigmas = sigma * rng.rand(n_features) + sigma / 2.0
          X += rng.randn(n_samples, n_features) * sigmas
          return X
  
      X = get_data(
          n_samples=n_samples,
          n_features=n_features,
          rank=rank,
          sigma=sigma,
      )
      method_params = {"iter_n_components": [4, 5, 6]}
      cv = 3
      n_jobs = 1
      mode = "factor_analysis"
      rescale = 1e8
      X *= rescale
      est, info = _auto_low_rank_model(
          X,
          mode=mode,
          n_jobs=n_jobs,
          method_params=method_params,
          cv=cv,
      )
      assert_equal(info["best"], rank)
  
      X = get_data(
          n_samples=n_samples,
          n_features=n_features,
          rank=rank,
          sigma=sigma,
      )
      method_params = {"iter_n_components": [n_features + 5]}
      msg = (
          "You are trying to estimate %i components on matrix "
          "with %i features."
      ) % (n_features + 5, n_features)
      with pytest.warns(RuntimeWarning, match=msg):
          _auto_low_rank_model(
              X,
              mode=mode,
              n_jobs=n_jobs,
              method_params=method_params,
              cv=cv,
          )
  
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 15 for calling a global function with example usage: test_auto_low_rank() and returns: X