code: def _eigvalsh_to_eps(spectrum, cond=None, rcond=None):
      """
      Determine which eigenvalues are "small" given the spectrum.
  
      This is for compatibility across various linear algebra functions
      that should agree about whether or not a Hermitian matrix is numerically
      singular and what is its numerical matrix rank.
      This is designed to be compatible with scipy.linalg.pinvh.
  
      Parameters
      ----------
      spectrum : 1d ndarray
          Array of eigenvalues of a Hermitian matrix.
      cond, rcond : float, optional
          Cutoff for small eigenvalues.
          Singular values smaller than rcond * largest_eigenvalue are
          considered zero.
          If None or -1, suitable machine precision is used.
  
      Returns
      -------
      eps : float
          Magnitude cutoff for numerical negligibility.
  
      """
      if rcond is not None:
          cond = rcond
      if cond in [None, -1]:
          t = spectrum.dtype.char.lower()
          factor = {"f": 1e3, "d": 1e6}
          cond = factor[t] * np.finfo(t).eps
      eps = cond * np.max(abs(spectrum))
      return eps
  
imports: import numpy
  import scipy.linalg
  from scipy._lib import doccer
  from scipy.special import gammaln
  from scipy._lib._util import check_random_state
  from scipy.stats import mvn
label_desc: Use image node_id 2 for calling a global function with example usage: _eigvalsh_to_eps(spectrum, cond, rcond) and returns: eps