def _display_time(seconds: float, granularity=2) ->str:
    """Return a human readable instruction for some time duration.

    Copy and pasted from:
    https://stackoverflow.com/questions/4048651/python-function-to-convert-seconds-into-minutes-hours-and-days/4048773

    If the number is positive, it returns the time with a granularity of 2.
    Example:

    ```python
    >>>display_time(3601)
    ..."for 1 hours 1 seconds"
    ```

    If the number is negative, hold the temperature.
    Example:

    ```python
    >>>display_time(-1)
    ..."hold"
    ```

    Args:
        seconds: the number of seconds of a step

    Keyword Args:
        granularity: the granularity of the displayed time

    Returns:
        the steps total time in human readable string format
    """
    if seconds < 1:
        return 'hold'
    seconds = round(seconds)
    intervals = ('weeks', 604800), ('days', 86400), ('hours', 3600), ('minutes'
        , 60), ('seconds', 1)
    result = []
    for name, count in intervals:
        value = seconds // count
        if value:
            seconds -= value * count
            if value == 1:
                name = name.rstrip('s')
            result.append('{} {}'.format(value, name))
    return 'for ' + ', '.join(result[:granularity])
