code: def solve_ex(A, B, *, left=True, check_errors=False, out=None):
      try:
          if left:
              result = ivy.solve(A, B, out=out)
          else:
              A_t = ivy.linalg.matrix_transpose(A)
              B_t = ivy.linalg.matrix_transpose(
                  B if B.ndim > 1 else ivy.reshape(B, (-1, 1))
              )
              X_t = ivy.solve(A_t, B_t)
              result = ivy.linalg.matrix_transpose(X_t, out=out)
  
          info = ivy.zeros(A.shape[:-2], dtype=ivy.int32)
          return result, info
      except RuntimeError as e:
          if check_errors:
              raise RuntimeError(e) from e
          else:
              result = A * math.nan
              info = ivy.ones(A.shape[:-2], dtype=ivy.int32)
  
              return result, info
  
imports: import math
  import ivy
  import ivy.functional.frontends.torch
  from ivy.functional.frontends.torch.func_wrapper import to_ivy_arrays_and_back
  from ivy.func_wrapper import with_supported_dtypes, with_unsupported_dtypes
  from collections import namedtuple
label_desc: Use image node_id 26 for calling a global function with example usage: solve_ex(A, B) and returns: result,  info, result,  info