def _is_dense(x):
 if (not isinstance(x, (scipy.sparse.spmatrix, np.ndarray))):
  raise NotImplementedError('this function should only be called on sparse.scipy.sparse.spmatrix or numpy.ndarray, not,', x)
 return isinstance(x, np.ndarray)

def _is_dense ( x ) : if ( not isinstance ( x , ( scipy . sparse . spmatrix , np . ndarray ) ) ) : raise NotImplementedError ( 'this function should only be called on sparse.scipy.sparse.spmatrix or numpy.ndarray, not,' , x ) return isinstance ( x , np . ndarray )
returns boolean true unless x is a l{scipy .