code: def copy(self, filename: Optional[PathLike] = None) -> 'AnnData':
          
          if not self.isbacked:
              return AnnData(self._X.copy() if self._X is not None else None,
                             self._obs.copy(),
                             self._var.copy(),
                             # deepcopy on DictView does not work and is unnecessary
                             # as uns was copied already before
                             self._uns.copy() if isinstance(self._uns, DictView) else deepcopy(self._uns),
                             self._obsm.copy(), self._varm.copy(),
                             raw=None if self._raw is None else self._raw.copy(),
                             layers=self.layers.as_dict(),
                             dtype=self._X.dtype.name if self._X is not None else 'float32')
          else:
              if filename is None:
                  raise ValueError(
                      'To copy an AnnData object in backed mode, '
                      'pass a filename: `.copy(filename=\'myfilename.h5ad\')`.')
              if self.isview:
                  self.write(filename)
              else:
                  from shutil import copyfile
                  copyfile(self.filename, filename)
              return AnnData(filename=filename)
docs: Full copy, optionally on disk.