def jot_obj(self, obj, name, comment=''):
    """
    write obj data to the note database, with whatever that should be noted.
    """
    had = self.db.keys('jot/'+name+'*')
    # if it the same name but a later version, we stupidly add a number to the 
    # so the name doesn't collide. Any better idea?
    suffix = ''
    if len(had)>0:
        pre = os.path.commonprefix(had)
        suf = [n.split(pre)[1] for n in had]
        versions = list(map(intm, suf))
        suffix = str(max(versions)+1)

    uname = 'jot/'+name+suffix

    # which one works better? 
    #all = ip.shadowhist.all()
    all = ip.shell.history_manager.input_hist_parsed

    # We may actually want to make snapshot of files that are run-ned.

    # get the comment 
    try:
        comment = ip.magic_edit('-x').strip()
    except:
        print("No comment is recorded.")
        comment = ''

    self.db[uname] = Struct({'val':obj, 
                'time'  :   datetime.now(), 
                'hist'  :   all,
                'name'  :   name,
                'comment' : comment,})

    print("Jotted down notes for '%s' (%s)" % (uname, obj.__class__.__name__))
dataset/ETHPy150Open ipython/ipython-py3k/IPython/quarantine/ipy_jot.py/jot_obj/original