def read_variables(ip, key=None):
    db = ip.db
    if key is None:
        return None
    else:
        keys = db.keys('jot/'+key)
    for key in keys:
        # strip autorestore
        justkey = os.path.basename(key)
        print("restoring from ", justkey) 
        try:
            obj = db[key]
        except KeyError:
            print(justkey % "Unable to read variable '%s', ignoring (use %%jot -d to forget!)")
            print("The error was:",sys.exc_info()[0])
        else:
            return obj
dataset/ETHPy150Open ipython/ipython-py3k/IPython/quarantine/ipy_jot.py/read_variables/swapped operands of `%`