code: def _median_biases(n):
      # Compute the biases for 0 to max(n, 1) terms included in a median calc
      biases = np.ones(n + 1)
      # The original SciPy code is:
      #
      # def _median_bias(n):
      #     ii_2 = 2 * np.arange(1., (n - 1) // 2 + 1)
      #     return 1 + np.sum(1. / (ii_2 + 1) - 1. / ii_2)
      #
      # This is a sum over (n-1)//2 terms.
      # The ii_2 terms here for different n are:
      #
      # n=0: []  # 0 terms
      # n=1: []  # 0 terms
      # n=2: []  # 0 terms
      # n=3: [2]  # 1 term
      # n=4: [2]  # 1 term
      # n=5: [2, 4]  # 2 terms
      # n=6: [2, 4]  # 2 terms
      # ...
      #
      # We can get the terms for 0 through n using a cumulative summation and
      # indexing:
      if n >= 3:
          ii_2 = 2 * np.arange(1, (n - 1) // 2 + 1)
          sums = 1 + np.cumsum(1.0 / (ii_2 + 1) - 1.0 / ii_2)
          idx = np.arange(2, n) // 2 - 1
          biases[3:] = sums[idx]
      return biases
  
file_path: mne-python/mne/time_frequency/psd.py
imports: from functools import partial
  import numpy
  from scipy.signal import spectrogram
  from ..parallel import parallel_func
  from ..utils import _check_option, _ensure_int, logger, verbose
label_desc: Use image node_id 1 for calling a global function with example usage: _median_biases(n) and returns: biases