def print_context(msg: Optional[str] = None, tabs=0):
    """Print the status of trulens context variables."""

    from trulens.core import instruments as core_instruments
    from trulens.core.feedback import endpoint as core_endpoint

    if msg is None:
        msg = python_utils.code_line(
            python_utils.caller_frameinfo(offset=1), show_source=True
        )

    contextvars = [
        core_instruments.WithInstrumentCallbacks._context_contexts,
        core_instruments.WithInstrumentCallbacks._stack_contexts,
        core_endpoint.Endpoint._context_endpoints,
    ]

    iprint(msg, tabs=tabs)

    for contextvar in contextvars:
        iprint(f"{contextvar.name} [{len(contextvar.get())}]", tabs=tabs + 1)
Print the status of trulens context variables.
src/core/trulens/core/_utils/debug.py