code: def _det_laplace(M):
      """Compute the determinant of a matrix using Laplace expansion.
  
      While Laplace expansion is not the most efficient method of computing
      a determinant, it is a simple one, and it has the advantage of
      being division free. To improve efficiency, this function uses
      caching to avoid recomputing determinants of submatrices.
      """
      if not M.is_square:
          raise NonSquareMatrixError()
      if M.shape[0] == 0:
          return M.one
          # sympy/matrices/tests/test_matrices.py contains a test that
          # suggests that the determinant of a 0 x 0 matrix is one, by
          # convention.
      return __det_laplace(M.as_immutable())
  
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 16 for calling a global function with example usage: _det_laplace(M) and returns: __det_laplace, M