

@contextmanager
def timer(log=None, message=None):
    if (log is not None):
        log('{}...'.format(message))
    info = {
        
    }
    t0 = time()
    (yield info)
    log['elapsed'] = (time() - t0)
    if (log is not None):
        log('{} done in {:.3f} sec.'.format(message, info['elapsed']))

dataset/ETHPy150Open ottogroup/palladium/palladium/util.py timer/VarMisuse@58/61 `info`->`log`