def function_moved(func: Callable, old: str, new: str):
    """Issue a warning upon function call that has been moved to a new location.

    Issues the warning only once. The given callable must have a name, so it
    cannot be a lambda.
    """

    if not hasattr(func, "__name__"):
        raise TypeError("Cannot create dep message without function name.")

    message = (
        f"Function `{func.__name__}` has moved:\n"
        f"\tOld import: `from {old} import {func.__name__}`\n"
        f"\tNew import: `from {new} import {func.__name__}`\n "
    )

    warned = False

    @functools.wraps(func)
    def _movedfunction(*args, **kwargs):
        nonlocal warned

        if not warned:
            warnings.warn(message, DeprecationWarning, stacklevel=2)
            warned = True

        return func(*args, **kwargs)

    _movedfunction.__doc__ = message

    return _movedfunction
Issue a warning upon function call that has been moved to a new location.

    Issues the warning only once. The given callable must have a name, so it
    cannot be a lambda.
    
src/core/trulens/core/utils/deprecation.py