code: def test_arma_generate_sample(dist, ar, ma):
      # Test that this generates a true ARMA process
      # (amounts to just a test that scipy.signal.lfilter does what we want)
      T = 100
      np.random.seed(1234)
      eta = dist(T)
  
      # rep1: from module function
      np.random.seed(1234)
      rep1 = arma_generate_sample(ar, ma, T, distrvs=dist)
      # rep2: "manually" create the ARMA process
      ar_params = -1 * np.array(ar[1:])
      ma_params = np.array(ma[1:])
      rep2 = _manual_arma_generate_sample(ar_params, ma_params, eta)
      assert_array_almost_equal(rep1, rep2, 13)
  
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 7 for calling a global function with example usage: test_arma_generate_sample(dist, ar, ma) without return types