code: def test02(self):
      width = 0.04
      beta = 12.0
      # ntaps must be odd for positive gain at Nyquist.
      ntaps = 401
      # An ideal highpass filter.
      freq = [0.0, 0.5, 0.5, 1.0]
      gain = [0.0, 0.0, 1.0, 1.0]
      taps = firwin2(ntaps, freq, gain, window=("kaiser", beta))
      freq_samples = np.array(
          [0.0, 0.25, 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), [0.0, 0.0, 0.0, 1.0, 1.0, 1.0], decimal=5
      )
  
imports: from __future__ import division, print_function, absolute_import
  import numpy
  from numpy.testing import assert_almost_equal, assert_array_almost_equal, assert_equal, assert_, assert_allclose, assert_warns
  from pytest import raises
  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 3 for calling the TestFirwin2 obj's underlying member method code with example usage: obj.test02() without return types