def _future_target_wrapper(stack, func, *args, **kwargs):
    """Wrapper for a function that is started by threads.

    This is needed to record the call stack prior to thread creation as in
    Python threads do not inherit the stack. Our instrumentation, however,
    relies on walking the stack and need to do this to the frames prior to
    thread starts.
    """

    # Keep this for looking up via get_first_local_in_call_stack .
    pre_start_stack = WeakWrapper(stack)  # noqa: F841 # pylint: disable=W0612

    # with with_context(context):
    return func(*args, **kwargs)
Wrapper for a function that is started by threads.

    This is needed to record the call stack prior to thread creation as in
    Python threads do not inherit the stack. Our instrumentation, however,
    relies on walking the stack and need to do this to the frames prior to
    thread starts.
    
src/core/trulens/core/utils/python.py