code: def test_continuous_regression_with_overlap():
      """Test regression with overlap correction."""
      pytest.importorskip("sklearn")
      signal = np.zeros(100000)
      times = [1000, 2500, 3000, 5000, 5250, 7000, 7250, 8000]
      events = np.zeros((len(times), 3), int)
      events[:, 2] = 1
      events[:, 0] = times
      signal[events[:, 0]] = 1.0
      effect = hann(101)
      signal = np.convolve(signal, effect)[: len(signal)]
      raw = RawArray(
          signal[np.newaxis, :], mne.create_info(1, 100, "eeg")
      )
  
      assert_allclose(
          effect,
          linear_regression_raw(raw, events, {1: 1}, tmin=0)[
              1
          ].data.flatten(),
      )
  
      # test that sklearn solvers can be used
      from sklearn.linear_model import ridge_regression
  
      def solver(X, y):
          return ridge_regression(X, y, alpha=0.0, solver="cholesky")
  
      assert_allclose(
          effect,
          linear_regression_raw(raw, events, tmin=0, solver=solver)[
              "1"
          ].data.flatten(),
      )
  
      # test bad solvers
      def solT(X, y):
          return ridge_regression(X, y, alpha=0.0, solver="cholesky").T
  
      pytest.raises(
          ValueError, linear_regression_raw, raw, events, solver=solT
      )
      pytest.raises(
          ValueError, linear_regression_raw, raw, events, solver="err"
      )
      pytest.raises(
          TypeError, linear_regression_raw, raw, events, solver=0
      )
  
file_path: mne-python/mne/stats/tests/test_regression.py
imports: import numpy
  import pytest
  from numpy.testing import assert_allclose, assert_array_equal, assert_equal
  from scipy.signal.windows import hann
  import mne
  from mne import read_source_estimate
  from mne.datasets import testing
  from mne.io import RawArray
  from mne.stats.regression import linear_regression, linear_regression_raw
label_desc: Use image node_id 3 for calling a global function with example usage: test_continuous_regression_with_overlap() and returns: ridge_regression, ridge_regression