def write_best_job(expt_dir, best_val, best_job, expt_grid):
 best_job_fh = open(os.path.join(expt_dir, 'best_job_and_result.txt'), 'w')
 best_job_fh.write(('Best result: %f\nJob-id: %d\nParameters: \n' % (best_val, best_job)))
 for best_params in expt_grid.get_params(best_job):
  best_job_fh.write(str(best_params))
 best_job_fh.close()

def write_best_job ( expt_dir , best_val , best_job , expt_grid ) : best_job_fh = open ( os . path . join ( expt_dir , 'best_job_and_result.txt' ) , 'w' ) best_job_fh . write ( ( 'Best result: %f\nJob-id: %d\nParameters: \n' % ( best_val , best_job ) ) ) for best_params in expt_grid . get_params ( best_job ) : best_job_fh . write ( str ( best_params ) ) best_job_fh . close ( )
write out the best_job_and_result .