code: def test_diagonal_averaging(X, arr_desired):
      """Test that the actual results are the expected ones."""
      X = np.asarray(X, dtype="float64")
      n_samples, grouping_size, window_size, n_windows = X.shape
      n_timestamps = window_size + n_windows - 1
      gap = max(n_windows, window_size)
  
      arr_actual = _diagonal_averaging(
          X,
          n_samples,
          n_timestamps,
          window_size,
          n_windows,
          grouping_size,
          gap,
      )
      np.testing.assert_allclose(
          arr_actual, arr_desired, atol=1e-5, rtol=0.0
      )
  
file_path: pyts/pyts/decomposition/tests/test_ssa.py
imports: import numpy
  import pytest
  import re
  from pyts.decomposition.ssa import _outer_dot, _diagonal_averaging
  from pyts.decomposition import SingularSpectrumAnalysis
label_desc: Use image node_id 2 for calling a global function with example usage: test_diagonal_averaging(X, arr_desired) without return types