def detail_variables(ip, key=None):
    db, get = ip.db, ip.db.get
 
    if key is None:
        keys = db.keys('jot/*')
    else:
        keys = db.keys('jot/'+key)
    if keys:
        size = max(list(map(len,keys)))
    else:
        size = 0

    fmthead = '%-'+str(size)+'s [%s]'
    fmtbody = 'Comment:\n %s'
    fmtdata = 'Data:\n %s, %s'
    for key in keys:
        v = get(key,'<unavailable>')
        justkey = os.path.basename(key)
        try: 
            print(fmthead % (justkey, datetime.ctime(v.get('time','<unavailable>'))))
            print(fmtbody % (v.get('comment','<unavailable>')))
            d = v.get('val','unavailable')
            print(fmtdata % (repr(type(d)), ''))
            print(repr(d)[0:200])
            print()
            print()
        except AttributeError:
            print((justkey, '<unavailable>', '<unavailable>', repr(v)[:50]) % fmt)
dataset/ETHPy150Open ipython/ipython-py3k/IPython/quarantine/ipy_jot.py/detail_variables/swapped operands of `%`