def wrap_lazy_values(
        self,
        rets: Any,
        wrap: Callable[[T], T],
        on_done: Callable[[T], T],
        context_vars: Optional[python_utils.ContextVarsOrValues],
    ) -> Any:
        """Wrap any lazy values in the return value of a method call to invoke
        handle_done when the value is ready.

        This is used to handle library-specific lazy values that are hidden in
        containers not visible otherwise. Visible lazy values like iterators,
        generators, awaitables, and async generators are handled elsewhere.

        Args:
            rets: The return value of the method call.

            wrap: A callback to be called when the lazy value is ready. Should
                return the input value or a wrapped version of it.

            on_done: Called when the lazy values is done and is no longer lazy.
                This as opposed to a lazy value that evaluates to another lazy
                values. Should return the value or wrapper.

            context_vars: The contextvars to be captured by the lazy value. If
                not given, all contexts are captured.

        Returns:
            The return value with lazy values wrapped.
        """

        if python_utils.is_lazy(rets):
            return rets

        return on_done(rets)
Wrap any lazy values in the return value of a method call to invoke
        handle_done when the value is ready.

        This is used to handle library-specific lazy values that are hidden in
        containers not visible otherwise. Visible lazy values like iterators,
        generators, awaitables, and async generators are handled elsewhere.

        Args:
            rets: The return value of the method call.

            wrap: A callback to be called when the lazy value is ready. Should
                return the input value or a wrapped version of it.

            on_done: Called when the lazy values is done and is no longer lazy.
                This as opposed to a lazy value that evaluates to another lazy
                values. Should return the value or wrapper.

            context_vars: The contextvars to be captured by the lazy value. If
                not given, all contexts are captured.

        Returns:
            The return value with lazy values wrapped.
        
src/core/trulens/core/instruments.py