code: def _get_rank_sss(
      inst,
      msg="You should use data-based rank estimate instead",
      verbose=None,
  ):
      """Look up rank from SSS data.
  
      .. note::
          Throws an error if SSS has not been applied.
  
      Parameters
      ----------
      inst : instance of Raw, Epochs or Evoked, or Info
          Any MNE object with an .info attribute
  
      Returns
      -------
      rank : int
          The numerical rank as predicted by the number of SSS
          components.
      """
      # XXX this is too basic for movement compensated data
      # https://github.com/mne-tools/mne-python/issues/4676
      info = inst if isinstance(inst, Info) else inst.info
      del inst
  
      proc_info = info.get("proc_history", [])
      if len(proc_info) > 1:
          logger.info("Found multiple SSS records. Using the first.")
      if (
          len(proc_info) == 0
          or "max_info" not in proc_info[0]
          or "in_order" not in proc_info[0]["max_info"]["sss_info"]
      ):
          raise ValueError(
              "Could not find Maxfilter information in "
              'info["proc_history"]. %s' % msg
          )
      proc_info = proc_info[0]
      max_info = proc_info["max_info"]
      inside = max_info["sss_info"]["in_order"]
      nfree = (inside + 1) ** 2 - 1
      nfree -= (
          len(max_info["sss_info"]["components"][:nfree])
          - max_info["sss_info"]["components"][:nfree].sum()
      )
      return nfree
  
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 6 for calling a global function with example usage: _get_rank_sss(inst, msg, verbose) and returns: nfree