code: def _filter_attenuation(h, freq, gain):
      """Compute minimum attenuation at stop frequency."""
      _, filt_resp = signal.freqz(h.ravel(), worN=np.pi * freq)
      filt_resp = np.abs(filt_resp)  # use amplitude response
      filt_resp[np.where(gain == 1)] = 0
      idx = np.argmax(filt_resp)
      att_db = -20 * np.log10(np.maximum(filt_resp[idx], 1e-20))
      att_freq = freq[idx]
      return att_db, att_freq
  
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 5 for calling a global function with example usage: _filter_attenuation(h, freq, gain) and returns: att_db,  att_freq