code: def check_maxfreq(self, spec, fsp, fstims):
      # skip the test if there are no frequencies
      if len(fstims) == 0:
          return
  
      # if twosided, do the test for each side
      if fsp.min() < 0:
          fspa = np.abs(fsp)
          zeroind = fspa.argmin()
          self.check_maxfreq(spec[:zeroind], fspa[:zeroind], fstims)
          self.check_maxfreq(spec[zeroind:], fspa[zeroind:], fstims)
          return
  
      fstimst = fstims[:]
      spect = spec.copy()
  
      # go through each peak and make sure it is correctly the maximum peak
      while fstimst:
          maxind = spect.argmax()
          maxfreq = fsp[maxind]
          assert_almost_equal(maxfreq, fstimst[-1])
          del fstimst[-1]
          spect[maxind - 5 : maxind + 5] = 0
  
imports: from numpy.testing import assert_allclose, assert_almost_equal, assert_array_equal, assert_array_almost_equal_nulp
  import numpy
  import pytest
  from matplotlib import mlab
label_desc: Use image node_id 3 for calling the TestSpectral obj's underlying member method code with example usage: obj.check_maxfreq(spec, fsp, fstims) without return types