code: def test_compute_reg_neighbors():
      """Test fast calculation of laplacian regularizer."""
      for reg_type in (
          ("ridge", "ridge"),
          ("ridge", "laplacian"),
          ("laplacian", "ridge"),
          ("laplacian", "laplacian"),
      ):
          for n_ch_x, n_delays in (
              (1, 1),
              (1, 2),
              (2, 1),
              (1, 3),
              (3, 1),
              (1, 4),
              (4, 1),
              (2, 2),
              (2, 3),
              (3, 2),
              (3, 3),
              (2, 4),
              (4, 2),
              (3, 4),
              (4, 3),
              (4, 4),
              (5, 4),
              (4, 5),
              (5, 5),
              (20, 9),
              (9, 20),
          ):
              for normed in (True, False):
                  reg_direct = _compute_reg_neighbors(
                      n_ch_x,
                      n_delays,
                      reg_type,
                      "direct",
                      normed=normed,
                  )
                  reg_csgraph = _compute_reg_neighbors(
                      n_ch_x,
                      n_delays,
                      reg_type,
                      "csgraph",
                      normed=normed,
                  )
                  assert_allclose(
                      reg_direct,
                      reg_csgraph,
                      atol=1e-7,
                      err_msg=f"{reg_type}: {(n_ch_x, n_delays)}",
                  )
  
imports: from pathlib import Path
  import numpy
  import pytest
  from numpy import einsum
  from numpy.fft import irfft, rfft
  from numpy.testing import assert_allclose, assert_array_equal, assert_equal
  from mne.decoding import ReceptiveField, TimeDelayingRidge
  from mne.decoding.receptive_field import _SCORERS, _delay_time_series, _delays_to_slice, _times_to_delays
  from mne.decoding.time_delaying_ridge import _compute_corrs, _compute_reg_neighbors
label_desc: Use image node_id 1 for calling a global function with example usage: test_compute_reg_neighbors() without return types