code: def lu_solve(
      lu_and_piv, b, trans=0, overwrite_b=False, check_finite=True
  ):
      """Solve an equation system, a x = b, given the LU factorization of a
  
      Parameters
      ----------
      (lu, piv)
          Factorization of the coefficient matrix a, as given by lu_factor
      b : array
          Right-hand side
      trans : {0, 1, 2}, optional
          Type of system to solve:
  
          =====  =========
          trans  system
          =====  =========
          0      a x   = b
          1      a^T x = b
          2      a^H x = b
          =====  =========
      overwrite_b : bool, optional
          Whether to overwrite data in b (may increase performance)
      check_finite : bool, optional
          Whether to check that the input matrices contain only finite numbers.
          Disabling may give a performance gain, but may result in problems
          (crashes, non-termination) if the inputs do contain infinities or NaNs.
  
      Returns
      -------
      x : array
          Solution to the system
  
      See also
      --------
      lu_factor : LU factorize a matrix
  
      Examples
      --------
      >>> from scipy.linalg import lu_factor, lu_solve
      >>> A = np.array([[2, 5, 8, 7], [5, 2, 2, 8], [7, 5, 6, 6], [5, 4, 4, 8]])
      >>> b = np.array([1, 1, 1, 1])
      >>> lu, piv = lu_factor(A)
      >>> x = lu_solve((lu, piv), b)
      >>> np.allclose(A @ x - b, np.zeros((4,)))
      True
  
      """
      (lu, piv) = lu_and_piv
      if check_finite:
          b1 = asarray_chkfinite(b)
      else:
          b1 = asarray(b)
      overwrite_b = overwrite_b or _datacopied(b1, b)
      if lu.shape[0] != b1.shape[0]:
          raise ValueError(
              "Shapes of lu {} and b {} are incompatible".format(
                  lu.shape, b1.shape
              )
          )
  
      (getrs,) = get_lapack_funcs(("getrs",), (lu, b1))
      x, info = getrs(lu, piv, b1, trans=trans, overwrite_b=overwrite_b)
      if info == 0:
          return x
      raise ValueError(
          "illegal value in %dth argument of internal gesv|posv" % -info
      )
  
file_path: catboost/contrib/python/scipy/py3/scipy/linalg/decomp_lu.py
imports: from warnings import warn
  from numpy import asarray, asarray_chkfinite
  from .misc import _datacopied, LinAlgWarning
  from .lapack import get_lapack_funcs
  from .flinalg import get_flinalg_funcs
label_desc: Use image node_id 2 for calling a global function with example usage: lu_solve(lu_and_piv, b, trans, overwrite_b, check_finite) and returns: x