def _is_2D_matrix(matrix):
return ((isinstance(matrix[<NUM_LIT:0>], list) and _rectangular(matrix) and<EOL>not isinstance(matrix[<NUM_LIT:0>][<NUM_LIT:0>], list)) or<EOL>(not isinstance(matrix, list) and matrix.shape == <NUM_LIT:2>))<EOL>
Checks to see if a ndarray is 2D or a list of lists is 2D