code: def test_trace_as_explicit():
      raises(ValueError, lambda: Trace(A).as_explicit())
  
      X = MatrixSymbol("X", 3, 3)
      assert Trace(X).as_explicit() == X[0, 0] + X[1, 1] + X[2, 2]
      assert Trace(eye(3)).as_explicit() == 3
  
file_path: sympy/sympy/matrices/expressions/tests/test_trace.py
imports: from sympy.core import Lambda, S, symbols
  from sympy.concrete import Sum
  from sympy.functions import adjoint, conjugate, transpose
  from sympy.matrices import eye, Matrix, ShapeError, ImmutableMatrix
  from sympy.matrices.expressions import Adjoint, Identity, FunctionMatrix, MatrixExpr, MatrixSymbol, Trace, ZeroMatrix, trace, MatPow, MatAdd, MatMul
  from sympy.matrices.expressions.special import OneMatrix
  from sympy.testing.pytest import raises
  from sympy.abc import i
label_desc: Use image node_id 10 for calling a global function with example usage: test_trace_as_explicit() without return types