code: def __det_laplace(M):
      """Compute the determinant of a matrix using Laplace expansion.
  
      This is a recursive function, and it should not be called directly.
      Use _det_laplace() instead. The reason for splitting this function
      into two is to allow caching of determinants of submatrices. While
      one could also define this function inside _det_laplace(), that
      would remove the advantage of using caching in Cramer Solve.
      """
      n = M.shape[0]
      if n == 1:
          return M[0]
      elif n == 2:
          return M[0, 0] * M[1, 1] - M[0, 1] * M[1, 0]
      else:
          return sum(
              (-1) ** i
              * M[0, i]
              * __det_laplace(M.minor_submatrix(0, i))
              for i in range(n)
          )
  
imports: from types import FunctionType
  from sympy.core.cache import cacheit
  from sympy.core.numbers import Float, Integer
  from sympy.core.singleton import S
  from sympy.core.symbol import uniquely_named_symbol
  from sympy.core.mul import Mul
  from sympy.polys import PurePoly, cancel
  from sympy.functions.combinatorial.numbers import nC
  from sympy.polys.matrices.domainmatrix import DomainMatrix
  from sympy.polys.matrices.ddm import DDM
  from .exceptions import NonSquareMatrixError
  from .utilities import _get_intermediate_simp, _get_intermediate_simp_bool, _iszero, _is_zero_after_expand_mul, _dotprodsimp, _simplify
label_desc: Use image node_id 15 for calling a global function with example usage: __det_laplace(M) and returns: M, unknown, sum