code: def mat_from_diag_triu_tril(diag, tri_upp, tri_low):
      """Build matrix from given components.
  
      Forms a matrix from diagonal, strictly upper triangular and
      strictly lower traingular parts.
  
      Parameters
      ----------
      diag : array_like, shape=[..., n]
      tri_upp : array_like, shape=[..., (n * (n - 1)) / 2]
      tri_low : array_like, shape=[..., (n * (n - 1)) / 2]
  
      Returns
      -------
      mat : array_like, shape=[..., n, n]
      """
      diag, tri_upp, tri_low = convert_to_wider_dtype(
          [diag, tri_upp, tri_low]
      )
  
      n = diag.shape[-1]
      (i,) = _np.diag_indices(n, ndim=1)
      j, k = _np.triu_indices(n, k=1)
      mat = zeros(diag.shape + (n,), dtype=diag.dtype)
      mat[..., i, i] = diag
      mat[..., j, k] = tri_upp
      mat[..., k, j] = tri_low
      return mat
  
imports: from ._dispatch import BACKEND_NAME, _common
  from ._dispatch import numpy
label_desc: Use image node_id 21 for calling a global function with example usage: mat_from_diag_triu_tril(diag, tri_upp, tri_low) and returns: mat