docs: def solve(A, b):
      r"""Solve for the linear equations :math:`\mathrm A \mathbf x = \mathbf b`.
  
      Args:
          A (array_like): Coefficient matrix.
          b (array_like): Ordinate values.
  
      Returns:
          :class:`numpy.ndarray`: Solution ``x``.
      """
      A = asarray(A, float)
      b = asarray(b, float)
      if A.shape[0] == 1:
  
          with errstate(divide="ignore"):
              A_ = array([[1.0 / A[0, 0]]])
  
          if not isfinite(A_[0, 0]):
              raise LinAlgError("Division error.")
  
          return dot(A_, b)
      elif A.shape[0] == 2:
          a = A[0, 0]
          b_ = A[0, 1]
          c = A[1, 0]
          d = A[1, 1]
          A_ = array([[d, -b_], [-c, a]])
  
          with errstate(divide="ignore"):
              A_ /= a * d - b_ * c
  
          if not npy_all(isfinite(A_)):
              raise LinAlgError("Division error.")
  
          return dot(A_, b)
      return _solve(A, b)