code: def _mt_spectrum_proc(
      x,
      sfreq,
      line_freqs,
      notch_widths,
      mt_bandwidth,
      p_value,
      picks,
      n_jobs,
      copy,
      filter_length,
  ):
      """Call _mt_spectrum_remove."""
      # set up array for filtering, reshape to 2D, operate on last axis
      x, orig_shape, picks = _prep_for_filtering(x, copy, picks)
      if isinstance(filter_length, str) and filter_length == "auto":
          filter_length = "10s"
      if filter_length is None:
          filter_length = x.shape[-1]
      filter_length = min(
          _to_samples(filter_length, sfreq, "", ""), x.shape[-1]
      )
      get_wt = partial(
          _get_window_thresh,
          sfreq=sfreq,
          mt_bandwidth=mt_bandwidth,
          p_value=p_value,
      )
      window_fun, threshold = get_wt(filter_length)
      parallel, p_fun, n_jobs = parallel_func(
          _mt_spectrum_remove_win, n_jobs
      )
      if n_jobs == 1:
          freq_list = list()
          for ii, x_ in enumerate(x):
              if ii in picks:
                  x[ii], f = _mt_spectrum_remove_win(
                      x_,
                      sfreq,
                      line_freqs,
                      notch_widths,
                      window_fun,
                      threshold,
                      get_wt,
                  )
                  freq_list.append(f)
      else:
          data_new = parallel(
              p_fun(
                  x_,
                  sfreq,
                  line_freqs,
                  notch_widths,
                  window_fun,
                  threshold,
                  get_wt,
              )
              for xi, x_ in enumerate(x)
              if xi in picks
          )
          freq_list = [d[1] for d in data_new]
          data_new = np.array([d[0] for d in data_new])
          x[picks, :] = data_new
  
      # report found frequencies, but do some sanitizing first by binning into
      # 1 Hz bins
      counts = Counter(
          sum(
              (
                  np.unique(np.round(ff)).tolist()
                  for f in freq_list
                  for ff in f
              ),
              list(),
          )
      )
      kind = "Detected" if line_freqs is None else "Removed"
      found_freqs = (
          "\n".join(
              f"    {freq:6.2f} : "
              f"{counts[freq]:4d} window{_pl(counts[freq])}"
              for freq in sorted(counts)
          )
          or "    None"
      )
      logger.info(f"{kind} notch frequencies (Hz):\n{found_freqs}")
  
      x.shape = orig_shape
      return x
  
imports: from collections import Counter
  from copy import deepcopy
  from functools import partial
  from math import gcd
  import numpy
  from scipy import fft, signal
  from scipy.stats import f
  from ._fiff.pick import _picks_to_idx
  from ._ola import _COLA
  from .cuda import _fft_multiply_repeated, _fft_resample, _setup_cuda_fft_multiply_repeated, _setup_cuda_fft_resample, _smart_pad
  from .parallel import parallel_func
  from .utils import _check_option, _check_preload, _ensure_int, _pl, _validate_type, logger, sum_squared, verbose, warn
label_desc: Use image node_id 19 for calling a global function with example usage: _mt_spectrum_proc(x, sfreq, line_freqs, notch_widths, mt_bandwidth, p_value, picks, n_jobs, copy, filter_length) and returns: x