code: def deconvolve(num, den, n=None):
      """Deconvolves divisor out of signal, division of polynomials for n terms
  
      calculates den^{-1} * num
  
      Parameters
      ----------
      num : array_like
          signal or lag polynomial
      denom : array_like
          coefficients of lag polynomial (linear filter)
      n : None or int
          number of terms of quotient
  
      Returns
      -------
      quot : ndarray
          quotient or filtered series
      rem : ndarray
          remainder
  
      Notes
      -----
      If num is a time series, then this applies the linear filter den^{-1}.
      If both num and den are both lag polynomials, then this calculates the
      quotient polynomial for n terms and also returns the remainder.
  
      This is copied from scipy.signal.signaltools and added n as optional
      parameter.
      """
      num = np.atleast_1d(num)
      den = np.atleast_1d(den)
      N = len(num)
      D = len(den)
      if D > N and n is None:
          quot = []
          rem = num
      else:
          if n is None:
              n = N - D + 1
          input = np.zeros(n, float)
          input[0] = 1
          quot = signal.lfilter(num, den, input)
          num_approx = signal.convolve(den, quot, mode="full")
          if len(num) < len(num_approx):  # 1d only ?
              num = np.concatenate(
                  (num, np.zeros(len(num_approx) - len(num)))
              )
          rem = num - num_approx
      return quot, rem
  
imports: from statsmodels.compat.numpy import NP_LT_2
  from statsmodels.compat.pandas import Appender
  import warnings
  import numpy
  from scipy import linalg, optimize, signal
  from statsmodels.tools.docstring import Docstring, remove_parameters
  from statsmodels.tools.validation import array_like
label_desc: Use image node_id 15 for calling a global function with example usage: deconvolve(num, den, n) and returns: quot,  rem