from typing import Union
import time


def time_format(seconds: float, format_='%H:%M:%S') -> Union[str, float]:
    """
    Default format is '%H:%M:%S'

    >>> time_format(3600)
    '01:00:00'

    """
    # this because NaN
    if seconds >= 0 or seconds < 0:
        time_ = time.strftime(format_, time.gmtime(abs(seconds)))
        if seconds < 0:
            return f"-{time_}"
        return time_
    return seconds