def test_modify_view_component(matrix_type, mapping_name):
    adata = ad.AnnData(
        np.zeros((10, 10)),
        **{mapping_name: dict(m=matrix_type(asarray(sparse.random(10, 10))))},
    )
    init_hash = joblib.hash(adata)

    subset = adata[:5, :][:, :5]
    assert subset.is_view
    m = getattr(subset, mapping_name)["m"]
    m[0, 0] = 100
    assert not subset.is_view
    assert getattr(subset, mapping_name)["m"][0, 0] == 100

    assert init_hash == joblib.hash(adata)
def __init__(self, *args, **kwargs):
        # If True, avoid entering subdirectories, and match everything recursively,
        # unconditionally.
        self.matchrecursive = False
        # If True, avoid entering subdirectories, and return "unsure" for
        # everything. This is set to True when complex re patterns (potentially
        # including "/") are used.
        self.unsurerecursive = False
        # Patterns for matching paths in this directory.
        self._kindpats = []
        # Glob patterns used to match parent directories of another glob
        # pattern.
        self._globdirpats = []
        super(_tree, self).__init__(*args, **kwargs)