code: def diag(*values, strict=True, unpack=False, **kwargs):
      """Returns a matrix with the provided values placed on the
      diagonal. If non-square matrices are included, they will
      produce a block-diagonal matrix.
  
      Examples
      ========
  
      This version of diag is a thin wrapper to Matrix.diag that differs
      in that it treats all lists like matrices -- even when a single list
      is given. If this is not desired, either put a `*` before the list or
      set `unpack=True`.
  
      >>> from sympy import diag
  
      >>> diag([1, 2, 3], unpack=True)  # = diag(1,2,3) or diag(*[1,2,3])
      Matrix([
      [1, 0, 0],
      [0, 2, 0],
      [0, 0, 3]])
  
      >>> diag([1, 2, 3])  # a column vector
      Matrix([
      [1],
      [2],
      [3]])
  
      See Also
      ========
      .matrixbase.MatrixBase.eye
      .matrixbase.MatrixBase.diagonal
      .matrixbase.MatrixBase.diag
      .expressions.blockmatrix.BlockMatrix
      """
      return Matrix.diag(
          *values, strict=strict, unpack=unpack, **kwargs
      )
  
imports: import random
  from sympy.core.basic import Basic
  from sympy.core.singleton import S
  from sympy.core.symbol import Symbol
  from sympy.core.sympify import sympify
  from sympy.functions.elementary.trigonometric import cos, sin
  from sympy.utilities.decorator import doctest_depends_on
  from sympy.utilities.exceptions import sympy_deprecation_warning
  from sympy.utilities.iterables import is_sequence
  from .exceptions import ShapeError
  from .decompositions import _cholesky, _LDLdecomposition
  from .matrixbase import MatrixBase
  from .repmatrix import MutableRepMatrix, RepMatrix
  from .solvers import _lower_triangular_solve, _upper_triangular_solve
label_desc: Use image node_id 15 for calling a global function with example usage: diag() and returns: Matrix