code: def test03(self):
      width = 0.02
      ntaps, beta = kaiserord(120, width)
      # ntaps must be odd for positive gain at Nyquist.
      ntaps = int(ntaps) | 1
      freq = [0.0, 0.4, 0.4, 0.5, 0.5, 1.0]
      gain = [1.0, 1.0, 0.0, 0.0, 1.0, 1.0]
      taps = firwin2(ntaps, freq, gain, window=("kaiser", beta))
      freq_samples = np.array(
          [
              0.0,
              0.4 - width,
              0.4 + width,
              0.45,
              0.5 - width,
              0.5 + width,
              0.75,
              1.0,
          ]
      )
      freqs, response = freqz(taps, worN=np.pi * freq_samples)
      assert_array_almost_equal(
          np.abs(response),
          [1.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0],
          decimal=5,
      )
  
imports: import numpy
  from numpy.testing import assert_almost_equal, assert_array_almost_equal, assert_equal, assert_, assert_allclose, assert_warns
  from pytest import raises
  import pytest
  from scipy.fft import fft
  from scipy.special import sinc
  from scipy.signal import kaiser_beta, kaiser_atten, kaiserord, firwin, firwin2, freqz, remez, firls, minimum_phase
label_desc: Use image node_id 4 for calling the TestFirwin2 obj's underlying member method code with example usage: obj.test03() without return types