code: def get_reference_data():
      ref = getattr(globals(), "__reference_data", None)
      if ref is not None:
          return ref
  
      # Matlab reference data
      MDATA = np.load(join(fftpack_test_dir, "test.npz"))
      X = [MDATA["x%d" % i] for i in range(MDATA_COUNT)]
      Y = [MDATA["y%d" % i] for i in range(MDATA_COUNT)]
  
      # FFTW reference data: the data are organized as follows:
      #    * SIZES is an array containing all available sizes
      #    * for every type (1, 2, 3, 4) and every size, the array dct_type_size
      #    contains the output of the DCT applied to the input np.linspace(0, size-1,
      #    size)
      FFTWDATA_DOUBLE = np.load(
          join(fftpack_test_dir, "fftw_double_ref.npz")
      )
      FFTWDATA_SINGLE = np.load(
          join(fftpack_test_dir, "fftw_single_ref.npz")
      )
      FFTWDATA_SIZES = FFTWDATA_DOUBLE["sizes"]
      assert len(FFTWDATA_SIZES) == FFTWDATA_COUNT
  
      if is_longdouble_binary_compatible():
          FFTWDATA_LONGDOUBLE = np.load(
              join(fftpack_test_dir, "fftw_longdouble_ref.npz")
          )
      else:
          FFTWDATA_LONGDOUBLE = {
              k: v.astype(np.longfloat)
              for k, v in FFTWDATA_DOUBLE.items()
          }
  
      ref = {
          "FFTWDATA_LONGDOUBLE": FFTWDATA_LONGDOUBLE,
          "FFTWDATA_DOUBLE": FFTWDATA_DOUBLE,
          "FFTWDATA_SINGLE": FFTWDATA_SINGLE,
          "FFTWDATA_SIZES": FFTWDATA_SIZES,
          "X": X,
          "Y": Y,
      }
  
      globals()["__reference_data"] = ref
      return ref
  
imports: from os.path import join, dirname
  from typing import Callable, Dict, Tuple, Union, Type
  import numpy
  from numpy.testing import assert_array_almost_equal, assert_equal, assert_allclose
  import pytest
  from pytest import raises
  from scipy.fft._pocketfft.realtransforms import dct, idct, dst, idst, dctn, idctn, dstn, idstn
label_desc: Use image node_id 2 for calling a global function with example usage: get_reference_data() and returns: ref, ref