code: def cleanup(data, clean='layers', keep=None, copy=False):
      adata = data.copy() if copy else data
      keep = list([keep]) if isinstance(keep, str) else list() if keep is None else list(keep)
      keep.extend(['spliced', 'unspliced', 'Ms', 'Mu', 'clusters', 'neighbors'])
      ann_dict = {'obs': adata.obs_keys(), 'var': adata.var_keys(),
                  'uns': adata.uns_keys(), 'layers': list(adata.layers.keys())}
      if 'all' not in clean:
          ann_dict = {ann: values for (ann, values) in ann_dict.items() if ann in clean}
      for (ann, values) in ann_dict.items():
          for value in values:
              if value not in keep: del(getattr(adata, ann)[value])
      return adata if copy else None