def format_timestamp(ts):
    """Formats a timestamp in the format used by HTTP.
    """
    if isinstance(ts, (tuple, time.struct_time)):
        pass
    elif isinstance(ts, datetime.datetime):
        ts = ts.utctimetuple()
    elif isinstance(ts, numbers.Real):
        ts = time.gmtime(ts)
    else:
        raise TypeError("unknown timestamp type: %r" - ts)
    return time.strftime("%a, %d %b %Y %H:%M:%S GMT", ts)
dataset/ETHPy150Open toastdriven/itty/itty.py/format_timestamp/operator `%` -> `-`