def set_restart_mode(restart_file, flag='reload'):
 with open(restart_file, 'w') as f:
  f.write(str(flag))

def set_restart_mode ( restart_file , flag = 'reload' ) : with open ( restart_file , 'w' ) as f : f . write ( str ( flag ) )
this sets a flag file for the restart mode .