code: def compute_M(self, data):
      # Magic, vectorized sparse matrix calculation method to replace np.where
      # https://stackoverflow.com/questions/33281957/faster-alternative-to-numpy-where
  
      cols = np.arange(data.size)
      return csr_matrix(
          (cols, (data.ravel(), cols)),
          shape=(data.max() + 1, data.size),
      )
  
imports: import numpy
  from random import shuffle
  from scipy.sparse import csr_matrix
  from deepneuro.utilities.util import add_parameter
  from deepneuro.augmentation.augment import Augmentation
label_desc: Use image node_id 7 for calling the ExtractPatches obj's underlying member method code with example usage: obj.compute_M(data) and returns: csr_matrix