code: def normalize_per_cell_weinreb16_deprecated(
      X,
      max_fraction=1,
      mult_with_mean=False,
  ) -> np.ndarray:
      
      if max_fraction < 0 or max_fraction > 1:
          raise ValueError('Choose max_fraction between 0 and 1.')
  
      counts_per_cell = X.sum(1).A1 if issparse(X) else X.sum(1)
      gene_subset = np.all(X <= counts_per_cell[:, None] * max_fraction, axis=0)
      if issparse(X): gene_subset = gene_subset.A1
      tc_include = X[:, gene_subset].sum(1).A1 if issparse(X) else X[:, gene_subset].sum(1)
  
      X_norm = X.multiply(csr_matrix(1/tc_include[:, None])) if issparse(X) else X / tc_include[:, None]
      if mult_with_mean:
          X_norm *= np.mean(counts_per_cell)
  
      return X_norm
docs: Normalize each cell [Weinreb17]_.
  
      This is a deprecated version. See `normalize_per_cell` instead.
  
      Normalize each cell by UMI count, so that every cell has the same total
      count.
  
      Parameters
      ----------
      X : np.ndarray
          Expression matrix. Rows correspond to cells and columns to genes.
      max_fraction : float, optional
          Only use genes that make up more than max_fraction of the total
          reads in every cell.
      mult_with_mean: bool, optional
          Multiply the result with the mean of total counts.
  
      Returns
      -------
      Normalized version of the original expression matrix.