@return_data_decorator
@app.route('/aggregatepars', methods=['POST'])
def submit_aggregate_pars():
    logger.info('receive aggregate files')
    recv_aggregate_files = request.files
    for filename in recv_aggregate_files:
        job_id = filename.split('_')[(- 2)]
        tmp_aggregate_file = recv_aggregate_files[filename]
        job_base_model_dir = os.path.join(BASE_MODEL_PATH, 'models_{}'.format(job_id), 'tmp_aggregate_pars')
        latest_num = (len(os.listdir(job_base_model_dir)) - 1)
        latest_tmp_aggretate_file_path = os.path.join(job_base_model_dir, 'avg_pars_{}'.format(latest_num))
        with open(latest_tmp_aggretate_file_path, 'wb') as f:
            for line in tmp_aggregate_file.readlines():
                f.write(line)
        logger.info('recv success')
    return ('ok', 200)
@return_data_decorator
@app.route('/aggregatepars', methods=['POST'])
def submit_aggregate_pars():
    logger.info('receive aggregate files')
    recv_aggregate_files = request.files
    for filename in recv_aggregate_files:
        job_id = filename.split('_')[(- 2)]
        tmp_aggregate_file = recv_aggregate_files[filename]
        job_base_model_dir = os.path.join(BASE_MODEL_PATH, 'models_{}'.format(job_id), 'tmp_aggregate_pars')
        latest_num = (len(os.listdir(job_base_model_dir)) - 1)
        latest_tmp_aggretate_file_path = os.path.join(job_base_model_dir, 'avg_pars_{}'.format(latest_num))
        with open(latest_tmp_aggretate_file_path, 'wb') as f:
            for line in tmp_aggregate_file.readlines():
                f.write(line)
        logger.info('recv success')
    return ('ok', 200)