def format_seconds(seconds: float, precision: int = 2) -> str:
    """Format seconds into human-readable time. This only goes up to days.

    Args:
        seconds (float): The number of seconds to format.
        precision (int, optional): The precision to use. Defaults to 2.

    Returns:
        str: The formatted time.
    """
    n_days = seconds // (60 * 60 * 24)
    n_hours = seconds // (60 * 60)
    n_minutes = seconds // 60
    if n_days:
        fmt_result = _format_unit("day", n_days, precision=precision)
        remaining_hours = seconds % (60 * 60 * 24) / (60 * 60)
        if remaining_hours >= 1:
            fmt_result += (
                f" {_format_unit('hour', remaining_hours, precision=precision)}"
            )
    elif n_hours:
        fmt_result = _format_unit("hour", n_hours, precision=precision)
        remaining_minutes = seconds % (60 * 60) / 60
        if remaining_minutes >= 1:
            fmt_result += f" {_format_unit('minute', remaining_minutes, precision=precision)}"
    elif n_minutes:
        fmt_result = _format_unit("minute", n_minutes, precision=precision)
        remaining_seconds = seconds % 60
        if remaining_seconds >= 1:
            fmt_result += f" {_format_unit('second', remaining_seconds, truncate=False, precision=precision)}"
    else:
        fmt_result = _format_unit(
            "second", seconds, truncate=False, precision=precision
        )
    return fmt_result
Format seconds into human-readable time. This only goes up to days.

    Args:
        seconds (float): The number of seconds to format.
        precision (int, optional): The precision to use. Defaults to 2.

    Returns:
        str: The formatted time.
    
src/core/trulens/core/utils/text.py