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 test_set_translation_reviewer_count_for_lang_code_adds_new_lang_key(
            self):
        community_contribution_stats = (
            suggestion_services.get_community_contribution_stats()
        )
        self._assert_community_contribution_stats_is_in_default_state()
        (
            community_contribution_stats
            .translation_reviewer_counts_by_lang_code
        ) = {'en': 1}

        (
            community_contribution_stats
            .set_translation_reviewer_count_for_language_code('hi', 2)
        )

        self.assertDictEqual(
            (
                community_contribution_stats
                .translation_reviewer_counts_by_lang_code
            ),
            {'en': 1, 'hi': 2}
        )