def backup_tmux(tmux_id):

    LOG.info('backing up the current tmux sessions')
    #id is timestamp
    parent_dir    = path.join(config.BACKUP_PATH,tmux_id)

    tmux          = tmux_obj.Tmux(tmux_id)
    tmux.create_time = datetime.datetime.fromtimestamp(time.time()).strftime('%Y-%m-%d %H:%M:%S')
    tmux.sessions = load_sessions()

    util.to_json(tmux, parent_dir, tmux_id + '.json')

    #if tmux and not os.path.exists(parent_dir):
        #os.makedirs(parent_dir)
    for s in tmux.sessions:
        for w in s.windows:
            for p in w.panes:
                cmd.capture_pane(p.idstr(), path.join(parent_dir,p.idstr()))

    LOG.info('Backup of sessions was saved under %s'%parent_dir)
Get all layers in this model.
dataset/ETHPy150Open sk1418/retmux/tmuxbk/backup.py/backup_tmux--crossover with--dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/models/dbm/dbm.py/DBM.get_all_layers