<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def num_taps(sample_rate, transitionwidth, gpass, gstop):
 """Returns the number of taps for an FIR filter with the given shape Parameters sample_rate : `float` sampling rate of target data transitionwidth : `float` the width (in the same units as `sample_rate` of the transition from stop-band to pass-band gpass : `float` the maximum loss in the passband (dB) gstop : `float` the minimum attenuation in the stopband (dB) Returns ------- numtaps : `int` the number of taps for an FIR filter Notes ----- Credit: http://dsp.stackexchange.com/a/31077/8223 """

    gpass = 10 ** (-gpass / 10.)
    gstop = 10 ** (-gstop / 10.)
    return int(2/3. * log10(1 / (10 * gpass * gstop)) *
               sample_rate / transitionwidth)