code: def lu_decomposition(matrix_a):
      
      # Check if the 2-dimensional input matrix is a square matrix
      q = len(matrix_a)
      for idx, m_a in enumerate(matrix_a):
          if len(m_a) != q:
              raise ValueError("The input must be a square matrix. " +
                               "Row " + str(idx + 1) + " has a size of " + str(len(m_a)) + ".")
  
      # Return L and U matrices
      return _linalg.doolittle(matrix_a)
docs: LU-Factorization method using Doolittle's Method for solution of linear systems.
  
      Decomposes the matrix :math:`A` such that :math:`A = LU`.
  
      The input matrix is represented by a list or a tuple. The input matrix is **2-dimensional**, i.e. list of lists of
      integers and/or floats.
  
      :param matrix_a: Input matrix (must be a square matrix)
      :type matrix_a: list, tuple
      :return: a tuple containing matrices L and U
      :rtype: tuple