code: def test_stationarity(batch_size, n_obs, dD, s, dtype, test_type):
      """Test stationarity tests against a reference implementation"""
      d, D = dD
  
      # Fix seed for stability
      np.random.seed(42)
  
      # Generate seasonal patterns with random walks
      pattern = np.zeros((s, batch_size))
      pattern[0, :] = np.random.uniform(-1.0, 1.0, batch_size)
      for i in range(1, s):
          pattern[i, :] = pattern[i - 1, :] + np.random.uniform(
              -1.0, 1.0, batch_size
          )
      pattern /= s
  
      # Decide for each series whether to include a linear and/or quadratic
      # trend and/or a seasonal pattern
      linear_mask = np.random.choice(
          [False, True], batch_size, p=[0.50, 0.50]
      )
      quadra_mask = np.random.choice(
          [False, True], batch_size, p=[0.75, 0.25]
      )
      season_mask = np.random.choice(
          [False, True], batch_size, p=[0.75, 0.25]
      )
  
      # Generate coefficients for the linear, quadratic and seasonal terms,
      # taking into account the masks computed above and avoiding coefficients
      # close to zero
      linear_coef = (
          linear_mask
          * np.random.choice([-1.0, 1.0], batch_size)
          * np.random.uniform(0.2, 2.0, batch_size)
      )
      quadra_coef = (
          quadra_mask
          * np.random.choice([-1.0, 1.0], batch_size)
          * np.random.uniform(0.2, 2.0, batch_size)
      )
      season_coef = season_mask * np.random.uniform(
          0.4, 0.8, batch_size
      )
  
      # Generate the data
      x = np.linspace(0.0, 2.0, n_obs)
      offset = np.random.uniform(-2.0, 2.0, batch_size)
      y = np.zeros((n_obs, batch_size), order="F", dtype=dtype)
      for i in range(n_obs):
          y[i, :] = (
              offset[:]
              + linear_coef[:] * x[i]
              + quadra_coef[:] * x[i] * x[i]
              + season_coef[:] * pattern[i % s, :]
              + np.random.normal(0.0, 0.2, batch_size)
          )
  
      # Call the cuML function
      test_cuml = cuml_tests[test_type](y, d, D, s)
  
      # Compute differenced data and call the reference function
      y_diff = prepare_data(y, d, D, s)
      test_ref = ref_tests[test_type](y_diff)
  
      np.testing.assert_array_equal(test_cuml, test_ref)
  
imports: from cuml.tsa import stationarity
  from statsmodels.tsa import stattools
  import warnings
  import pytest
  from cuml.internals.safe_imports import cpu_only_import
label_desc: Use image node_id 3 for calling a global function with example usage: test_stationarity(batch_size, n_obs, dD, s, dtype, test_type) without return types