def axis0_safe_slice(X, mask, len_mask):
 if (len_mask != 0):
  return X[safe_mask(X, mask), :]
 return np.zeros(shape=(0, X.shape[1]))

def axis0_safe_slice ( X , mask , len_mask ) : if ( len_mask != 0 ) : return X [ safe_mask ( X , mask ) , : ] return np . zeros ( shape = ( 0 , X . shape [ 1 ] ) )
this mask is safer than safe_mask since it returns an empty array .