code: def recipe_weinreb17(adata, log=True, mean_threshold=0.01, cv_threshold=2,
                       n_pcs=50, svd_solver='randomized', random_state=0,
                       copy=False):
      
      from scipy.sparse import issparse
      if issparse(adata.X):
          raise ValueError('`recipe_weinreb16 does not support sparse matrices.')
      if copy: adata = adata.copy()
      if log: pp.log1p(adata)
      adata.X = pp.normalize_per_cell_weinreb16_deprecated(adata.X,
                                                           max_fraction=0.05,
                                                           mult_with_mean=True)
      gene_subset = filter_genes_cv_deprecated(adata.X, mean_threshold, cv_threshold)
      adata._inplace_subset_var(gene_subset)  # this modifies the object itself
      X_pca = pp.pca(pp.zscore_deprecated(adata.X),
                     n_comps=n_pcs, svd_solver=svd_solver, random_state=random_state)
      # update adata
      adata.obsm['X_pca'] = X_pca
      return adata if copy else None
docs: Normalization and filtering as of [Weinreb17]_.
  
      Expects non-logarithmized data. If using logarithmized data, pass `log=False`.
  
      Parameters
      ----------
      adata : :class:`~anndata.AnnData`
          Annotated data matrix.
      copy : bool (default: False)
          Return a copy if true.