code: def _LUdecomposition(
      M, iszerofunc=_iszero, simpfunc=None, rankcheck=False
  ):
      """Returns (L, U, perm) where L is a lower triangular matrix with unit
      diagonal, U is an upper triangular matrix, and perm is a list of row
      swap index pairs. If A is the original matrix, then
      ``A = (L*U).permuteBkwd(perm)``, and the row permutation matrix P such
      that $P A = L U$ can be computed by ``P = eye(A.rows).permuteFwd(perm)``.
  
      See documentation for LUCombined for details about the keyword argument
      rankcheck, iszerofunc, and simpfunc.
  
      Parameters
      ==========
  
      rankcheck : bool, optional
          Determines if this function should detect the rank
          deficiency of the matrixis and should raise a
          ``ValueError``.
  
      iszerofunc : function, optional
          A function which determines if a given expression is zero.
  
          The function should be a callable that takes a single
          SymPy expression and returns a 3-valued boolean value
          ``True``, ``False``, or ``None``.
  
          It is internally used by the pivot searching algorithm.
          See the notes section for a more information about the
          pivot searching algorithm.
  
      simpfunc : function or None, optional
          A function that simplifies the input.
  
          If this is specified as a function, this function should be
          a callable that takes a single SymPy expression and returns
          an another SymPy expression that is algebraically
          equivalent.
  
          If ``None``, it indicates that the pivot search algorithm
          should not attempt to simplify any candidate pivots.
  
          It is internally used by the pivot searching algorithm.
          See the notes section for a more information about the
          pivot searching algorithm.
  
      Examples
      ========
  
      >>> from sympy import Matrix
      >>> a = Matrix([[4, 3], [6, 3]])
      >>> L, U, _ = a.LUdecomposition()
      >>> L
      Matrix([
      [  1, 0],
      [3/2, 1]])
      >>> U
      Matrix([
      [4,    3],
      [0, -3/2]])
  
      See Also
      ========
  
      sympy.matrices.dense.DenseMatrix.cholesky
      sympy.matrices.dense.DenseMatrix.LDLdecomposition
      QRdecomposition
      LUdecomposition_Simple
      LUdecompositionFF
      LUsolve
      """
  
      combined, p = M.LUdecomposition_Simple(
          iszerofunc=iszerofunc, simpfunc=simpfunc, rankcheck=rankcheck
      )
  
      # L is lower triangular ``M.rows x M.rows``
      # U is upper triangular ``M.rows x M.cols``
      # L has unit diagonal. For each column in combined, the subcolumn
      # below the diagonal of combined is shared by L.
      # If L has more columns than combined, then the remaining subcolumns
      # below the diagonal of L are zero.
      # The upper triangular portion of L and combined are equal.
      def entry_L(i, j):
          if i < j:
              # Super diagonal entry
              return M.zero
          elif i == j:
              return M.one
          elif j < combined.cols:
              return combined[i, j]
  
          # Subdiagonal entry of L with no corresponding
          # entry in combined
          return M.zero
  
      def entry_U(i, j):
          return M.zero if i > j else combined[i, j]
  
      L = M._new(combined.rows, combined.rows, entry_L)
      U = M._new(combined.rows, combined.cols, entry_U)
  
      return L, U, p
  
imports: import copy
  from sympy.core import S
  from sympy.core.function import expand_mul
  from sympy.functions.elementary.miscellaneous import Min, sqrt
  from sympy.functions.elementary.complexes import sign
  from .exceptions import NonSquareMatrixError, NonPositiveDefiniteMatrixError
  from .utilities import _get_intermediate_simp, _iszero
  from .determinant import _find_reasonable_pivot_naive
label_desc: Use image node_id 8 for calling a global function with example usage: _LUdecomposition(M, iszerofunc, simpfunc, rankcheck) and returns: L,  U,  p, M, unknown, M, M, combined