code: def test_estimate_rank():
      """Test rank estimation."""
      data = np.eye(10)
      assert_array_equal(
          estimate_rank(data, return_singular=True)[1], np.ones(10)
      )
      data[0, 0] = 0
      assert estimate_rank(data) == 9
      pytest.raises(ValueError, estimate_rank, data, "foo")
  
file_path: mne-python/mne/tests/test_rank.py
imports: import itertools
  from pathlib import Path
  import numpy
  import pytest
  from numpy.testing import assert_array_equal
  from mne import compute_raw_covariance, make_fixed_length_epochs, pick_info, pick_types, read_cov, read_evokeds
  from mne._fiff.pick import _picks_by_type
  from mne._fiff.proj import _has_eeg_average_ref_proj
  from mne.cov import prepare_noise_cov
  from mne.datasets import testing
  from mne.io import read_raw_fif
  from mne.proj import compute_proj_raw
  from mne.rank import _compute_rank_int, _estimate_rank_raw, _get_rank_sss, compute_rank, estimate_rank
label_desc: Use image node_id 1 for calling a global function with example usage: test_estimate_rank() without return types