def _activate(self, prev_ctx=None, thread_id=None):
        """set self as the current context"""
        # activate this context if different from the previous context
        thread_id = thread_id if thread_id is not None else PyThread_get_thread_ident()
        if prev_ctx is None:
            try:
                prev_ctx = _current_contexts[thread_id]
            except __HOLE__:
                pass

        _current_contexts[thread_id] = self
        return Cookie(thread_id, prev_ctx)
dataset/ETHPy150Open manahl/mdf/mdf/context.py/MDFContext._activate