code: def filter_and_normalize(data, min_counts=None, min_counts_u=None, min_cells=None, min_cells_u=None,
                           min_shared_counts=None, min_shared_cells=None, n_top_genes=None, flavor='seurat', log=True,
                           copy=False):
      adata = data.copy() if copy else data
      if 'spliced' not in adata.layers.keys() or 'unspliced' not in adata.layers.keys():
          raise ValueError('Could not find spliced / unspliced counts.')
      filter_genes(adata, min_counts=min_counts, min_counts_u=min_counts_u, min_cells=min_cells, min_cells_u=min_cells_u,
                   min_shared_counts=min_shared_counts, min_shared_cells=min_shared_cells,)
      normalize_per_cell(adata)
      if n_top_genes is not None:
          filter_genes_dispersion(adata, n_top_genes=n_top_genes, flavor=flavor)
      log_advised = np.allclose(adata.X[:10].sum(), adata.layers['spliced'][:10].sum())
      if log and log_advised:
          log1p(adata)
      logg.info('Logarithmized X.' if log and log_advised else
                'Did not modify X as it looks preprocessed already.' if log else
                'Consider logarithmizing X with `scv.pp.log1p` for better results.' if log_advised else '')
      return adata if copy else None