def format_timestamp(ts):
    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)
Match and store Fenced Code Blocks in the HtmlStash.
dataset/ETHPy150Open toastdriven/itty/itty.py/format_timestamp--crossover with--dataset/ETHPy150Open natestedman/Observatory/observatory/lib/markdown/extensions/fenced_code.py/FencedBlockPreprocessor.run