code: def _manual_arma_generate_sample(ar, ma, eta):
      T = len(eta)
      ar = ar[::-1]
      ma = ma[::-1]
      p, q = len(ar), len(ma)
      rep2 = [0] * max(p, q)  # initialize with zeroes
      for t in range(T):
          yt = eta[t]
          if p:
              yt += np.dot(rep2[-p:], ar)
          if q:
              # left pad shocks with zeros
              yt += np.dot(
                  [0] * (q - t) + list(eta[max(0, t - q) : t]), ma
              )
          rep2.append(yt)
      return np.array(rep2[max(p, q) :])
  
imports: from statsmodels.compat.pandas import QUARTER_END
  import datetime
  import numpy
  from numpy.testing import assert_, assert_allclose, assert_almost_equal, assert_array_almost_equal, assert_equal, assert_raises
  import pandas
  import pytest
  from statsmodels.sandbox.tsa.fftarma import ArmaFft
  from statsmodels.tsa.arima.model import ARIMA
  from statsmodels.tsa.arima_process import ArmaProcess, arma_acf, arma_acovf, arma_generate_sample, arma_impulse_response, index2lpol, lpol2index, lpol_fiar, lpol_fima
  from statsmodels.tsa.tests.results import results_arma_acf
  from statsmodels.tsa.tests.results.results_process import armarep
label_desc: Use image node_id 6 for calling a global function with example usage: _manual_arma_generate_sample(ar, ma, eta) and returns: np