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 get_organizations(self):
        legis = Organization('Minnesota Legislature', classification='legislature')

        upper = Organization('Minnesota Senate', classification='upper',
                             parent_id=legis._id)
        lower = Organization('Minnesota House of Representatives',
                             classification='lower', parent_id=legis._id)

        for n in range(1, 68):
            upper.add_post(label=str(n), role='Senator',
                           division_id='ocd-division/country:us/state:mn/sldu:{}'.format(n))
            lower.add_post(label=str(n) + 'A', role='Representative',
                           division_id='ocd-division/country:us/state:mn/sldl:{}a'.format(n))
            lower.add_post(label=str(n) + 'B', role='Representative',
                           division_id='ocd-division/country:us/state:mn/sldl:{}b'.format(n))

        yield legis
        yield upper
        yield lower