def _have_context() -> bool:
        """Determine whether context vars we need for recording are available."""

        try:
            WithInstrumentCallbacks._context_contexts.get()
            WithInstrumentCallbacks._stack_contexts.get()

        except LookupError:
            logger.warning(core_endpoint._NO_CONTEXT_WARNING)
            return False

        return True
Determine whether context vars we need for recording are available.
src/core/trulens/core/instruments.py