async def awith_context(context_vars: Optional[ContextVarsOrValues] = None):
    """Context manager to set context variables to given values.

    Args:
        context_vars: The context variables to set. If a dictionary is given,
            the keys are the context variables and the values are the values to
            set them to. If an iterable is given, it should be a list of context
            variables to set to their current value.
    """

    try:
        tokens = set_context_vars_or_values(context_vars)
        yield

    finally:
        for cv, v in tokens.items():
            try:
                cv.reset(v)
            except Exception as e:
                logger.warning("Context reset failed: %s", e)
Context manager to set context variables to given values.

    Args:
        context_vars: The context variables to set. If a dictionary is given,
            the keys are the context variables and the values are the values to
            set them to. If an iterable is given, it should be a list of context
            variables to set to their current value.
    
src/core/trulens/core/utils/python.py