code: def lstsq(a, b, rcond="warn"):
      solution = ivy.matmul(
          ivy.pinv(a, rtol=1e-15).astype(ivy.float64),
          b.astype(ivy.float64),
      )
      svd = ivy.svd(a, compute_uv=False)
      rank = matrix_rank(a).astype(ivy.int32)
      residuals = ivy.sum((b - ivy.matmul(a, solution)) ** 2).astype(
          ivy.float64
      )
      return (solution, residuals, rank, svd[0])
  
file_path: ivy/ivy/functional/frontends/numpy/linalg/solving_equations_and_inverting_matrices.py
imports: import ivy
  from ivy.functional.frontends.numpy.func_wrapper import to_ivy_arrays_and_back
  from ivy.func_wrapper import with_unsupported_dtypes
  from ivy.functional.frontends.numpy import promote_types_of_numpy_inputs
  from ivy.functional.frontends.numpy.linalg.norms_and_other_numbers import matrix_rank
label_desc: Use image node_id 2 for calling a global function with example usage: lstsq(a, b, rcond) and returns: solution,  residuals,  rank,  svd