def test_view_delattr(attr, subset_func):
    base = gen_adata((10, 10))
    orig_hash = joblib.hash(base)
    subset = base[subset_func(base.obs_names), subset_func(base.var_names)]
    empty = ad.AnnData(obs=subset.obs[[]], var=subset.var[[]])

    delattr(subset, attr)

    assert not subset.is_view
    # Should now have same value as default
    assert_equal(getattr(subset, attr), getattr(empty, attr))
    assert orig_hash == joblib.hash(base)  # Original should not be modified
def _execute_rpc_implementor_background(self, context, audit_name, target,
                                           response_queue, args, kwargs):
        """
        Honor a remote procedure call request from a plugin,
        from a background thread. Must only be used as the entry
        point for said background thread!

        :param context: Plugin execution context.
        :type context: PluginContext

        :param audit_name: Name of the audit requesting the call.
        :type audit_name: str

        :param target: RPC implementor function.
        :type target: callable

        :param response_queue: Response queue identity.
        :type response_queue: str

        :param args: Positional arguments to the call.
        :type args: tuple

        :param kwargs: Keyword arguments to the call.
        :type kwargs: dict
        """
        Config._context = context
        self.execute_rpc_implementor(
            audit_name, target, response_queue, args, kwargs)