def test_deepcopy_subset(adata, spmat: type):
    adata.obsp["arr"] = np.zeros((adata.n_obs, adata.n_obs))
    adata.obsp["spmat"] = spmat((adata.n_obs, adata.n_obs))

    adata = deepcopy(adata[:10].copy())

    assert isinstance(adata.obsp["arr"], np.ndarray)
    assert not isinstance(adata.obsp["arr"], ArrayView)
    np.testing.assert_array_equal(adata.obsp["arr"].shape, (10, 10))

    assert isinstance(adata.obsp["spmat"], spmat)
    assert not isinstance(
        adata.obsp["spmat"],
        SparseCSRView if spmat is sparse.csr_matrix else SparseCSCView,
    )
    np.testing.assert_array_equal(adata.obsp["spmat"].shape, (10, 10))
def _make_proxy(self, key, match):
        proxy_type = match.group("type")
        key = match.group("key").strip()
        if proxy_type == "env":
            proxy = EnvProxy(key)
        else:
            proxy = ResolverMethodProxy(self._resolver, proxy_type, key)
        filters = [f for f in [rf.strip() for rf in match.group("filters").split("|")] if f]
        for filter_name in filters:
            if filter_name == "jsondecode":
                proxy = JSONDecodeFilter(proxy)
            elif filter_name == "base64decode":
                proxy = Base64DecodeFilter(proxy)
            elif filter_name.startswith("element:"):
                key = filter_name.split(":", 1)[-1]
                proxy = ElementFilter(key, proxy)
            else:
                raise ValueError("Unknown filter %s", filter_name)
        return proxy