code: def test_rank_deficient(self):
      # solve() runs but warns (only sometimes, so here we don't use match)
      x = firls(21, [0, 0.1, 0.9, 1], [1, 1, 0, 0])
      w, h = freqz(x, fs=2.0)
      assert_allclose(np.abs(h[:2]), 1.0, atol=1e-5)
      assert_allclose(np.abs(h[-2:]), 0.0, atol=1e-6)
      # switch to pinvh (tolerances could be higher with longer
      # filters, but using shorter ones is faster computationally and
      # the idea is the same)
      x = firls(101, [0, 0.01, 0.99, 1], [1, 1, 0, 0])
      w, h = freqz(x, fs=2.0)
      mask = w < 0.01
      assert mask.sum() > 3
      assert_allclose(np.abs(h[mask]), 1.0, atol=1e-4)
      mask = w > 0.99
      assert mask.sum() > 3
      assert_allclose(np.abs(h[mask]), 0.0, atol=1e-4)
  
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 TestFirls obj's underlying member method code with example usage: obj.test_rank_deficient() without return types