code: def solve_triangular(
      x1: np.ndarray,
      x2: np.ndarray,
      /,
      *,
      upper: bool = True,
      adjoint: bool = False,
      unit_diagonal: bool = False,
      out: Optional[np.ndarray] = None,
  ) -> np.ndarray:
      # NumPy does not expose an API for `trsm`, so we have to implement substitution
      # in Python. There is no need to support gradients for this backend.
      # Pre: `x1` is square, `x1` and `x2` have the same number `n` of rows.
      n = x1.shape[-2]
      ret = x2.copy()
  
      if adjoint:
          x1 = _adjoint(x1)
          upper = not upper
  
      if unit_diagonal:
          for i in range(n):
              x1[..., i, i] = 1
  
      if upper:
          for i in reversed(range(n)):
              ret[..., i, :] /= x1[..., i, np.newaxis, i]
              ret[..., :i, :] -= (
                  x1[..., :i, np.newaxis, i]
                  * ret[..., np.newaxis, i, :]
              )
      else:
          for i in range(n):
              ret[..., i, :] /= x1[..., i, np.newaxis, i]
              ret[..., i + 1 :, :] -= (
                  x1[..., i + 1 :, np.newaxis, i]
                  * ret[..., np.newaxis, i, :]
              )
  
      return ret
  
file_path: ivy/ivy/functional/backends/numpy/experimental/linear_algebra.py
imports: import math
  from typing import Optional, Tuple, Sequence, Union, Any
  import numpy
  import ivy
  from ivy.func_wrapper import with_supported_dtypes, with_unsupported_dtypes
  from ivy.utils.exceptions import IvyNotImplementedException
  from ..None import backend_version
  from ivy.functional.ivy.experimental.linear_algebra import _check_valid_dimension_size
label_desc: Use image node_id 7 for calling a global function with example usage: solve_triangular() and returns: ret