code: def _build_and_solve_system(y, d, smoothing, kernel, epsilon, powers):
      """Build and solve the RBF interpolation system of equations.
  
      Parameters
      ----------
      y : (P, N) float ndarray
          Data point coordinates.
      d : (P, S) float ndarray
          Data values at `y`.
      smoothing : (P,) float ndarray
          Smoothing parameter for each data point.
      kernel : str
          Name of the RBF.
      epsilon : float
          Shape parameter.
      powers : (R, N) int ndarray
          The exponents for each monomial in the polynomial.
  
      Returns
      -------
      coeffs : (P + R, S) float ndarray
          Coefficients for each RBF and monomial.
      shift : (N,) float ndarray
          Domain shift used to create the polynomial matrix.
      scale : (N,) float ndarray
          Domain scaling used to create the polynomial matrix.
  
      """
      lhs, rhs, shift, scale = _build_system(
          y, d, smoothing, kernel, epsilon, powers
      )
      _, _, coeffs, info = dgesv(
          lhs, rhs, overwrite_a=True, overwrite_b=True
      )
      if info < 0:
          raise ValueError(
              f"The {-info}-th argument had an illegal value."
          )
      elif info > 0:
          msg = "Singular matrix."
          nmonos = powers.shape[0]
          if nmonos > 0:
              pmat = _polynomial_matrix((y - shift) / scale, powers)
              rank = np.linalg.matrix_rank(pmat)
              if rank < nmonos:
                  msg = (
                      "Singular matrix. The matrix of monomials evaluated at "
                      "the data point coordinates does not have full column "
                      f"rank ({rank}/{nmonos})."
                  )
  
          raise LinAlgError(msg)
  
      return shift, scale, coeffs
  
file_path: scipy/scipy/interpolate/_rbfinterp.py
imports: import warnings
  from itertools import combinations_with_replacement
  import numpy
  from numpy.linalg import LinAlgError
  from scipy.spatial import KDTree
  from scipy.special import comb
  from scipy.linalg.lapack import dgesv
  from ._rbfinterp_pythran import _build_system, _build_evaluation_coefficients, _polynomial_matrix
label_desc: Use image node_id 2 for calling a global function with example usage: _build_and_solve_system(y, d, smoothing, kernel, epsilon, powers) and returns: shift,  scale,  coeffs