code: def _fit_corrs(x_xt, x_y, n_ch_x, reg_type, alpha, n_ch_in):
      """Fit the model using correlation matrices."""
      # do the regularized solving
      n_ch_out = x_y.shape[1]
      assert x_y.shape[0] % n_ch_x == 0
      n_delays = x_y.shape[0] // n_ch_x
      reg = _compute_reg_neighbors(n_ch_x, n_delays, reg_type)
      mat = x_xt + alpha * reg
      # From sklearn
      try:
          # Note: we must use overwrite_a=False in order to be able to
          #       use the fall-back solution below in case a LinAlgError
          #       is raised
          w = linalg.solve(mat, x_y, overwrite_a=False, assume_a="pos")
      except np.linalg.LinAlgError:
          warn(
              "Singular matrix in solving dual problem. Using "
              "least-squares solution instead."
          )
          w = linalg.lstsq(mat, x_y, lapack_driver="gelsy")[0]
      w = w.T.reshape([n_ch_out, n_ch_in, n_delays])
      return w
  
imports: import numpy
  from scipy import linalg
  from scipy.signal import fftconvolve
  from scipy.sparse.csgraph import laplacian
  from ..cuda import _setup_cuda_fft_multiply_repeated
  from ..filter import next_fast_len
  from ..fixes import jit
  from ..utils import ProgressBar, _check_option, _validate_type, logger, warn
  from .base import BaseEstimator
label_desc: Use image node_id 5 for calling a global function with example usage: _fit_corrs(x_xt, x_y, n_ch_x, reg_type, alpha, n_ch_in) and returns: w