code: def estimate_rank(
      data,
      tol="auto",
      return_singular=False,
      norm=True,
      tol_kind="absolute",
      verbose=None,
  ):
      """Estimate the rank of data.
  
      This function will normalize the rows of the data (typically
      channels or vertices) such that non-zero singular values
      should be close to one.
  
      Parameters
      ----------
      data : array
          Data to estimate the rank of (should be 2-dimensional).
      %(tol_rank)s
      return_singular : bool
          If True, also return the singular values that were used
          to determine the rank.
      norm : bool
          If True, data will be scaled by their estimated row-wise norm.
          Else data are assumed to be scaled. Defaults to True.
      %(tol_kind_rank)s
  
      Returns
      -------
      rank : int
          Estimated rank of the data.
      s : array
          If return_singular is True, the singular values that were
          thresholded to determine the rank are also returned.
      """
      if norm:
          data = data.copy()  # operate on a copy
          norms = _compute_row_norms(data)
          data /= norms[:, np.newaxis]
      s = linalg.svdvals(data)
      rank = _estimate_rank_from_s(s, tol, tol_kind)
      if return_singular is True:
          return rank, s
      else:
          return rank
  
file_path: mne-python/mne/rank.py
imports: import numpy
  from scipy import linalg
  from ._fiff.meas_info import Info, _simplify_info
  from ._fiff.pick import _picks_by_type, _picks_to_idx, pick_channels_cov, pick_info
  from ._fiff.proj import make_projector
  from .defaults import _handle_default
  from .utils import _apply_scaling_cov, _check_on_missing, _check_rank, _compute_row_norms, _on_missing, _pl, _scaled_array, _undo_scaling_cov, _validate_type, fill_doc, logger, verbose, warn
label_desc: Use image node_id 1 for calling a global function with example usage: estimate_rank(data, tol, return_singular, norm, tol_kind, verbose) and returns: rank,  s, rank