def METHOD_NAME(logs_dir, step, total_iters, output):
    scores = pd.read_csv(os.path.join(logs_dir, "test_metric.tsv"), sep="\t")
    score_values = scores.iloc[:, 1]
    if 'RMSE' in "".join(scores.columns):
        best = min(score_values)
    else:
        best = max(score_values)
    best_iter = int(scores.iloc[int(max(scores.index[score_values == best])),0])
    time_to_best = pd.read_csv(os.path.join(logs_dir, "time_left.tsv"), header=None, sep="\t").iloc[
        best_iter - 1, 2]
    with open(output, 'a+') as outfile:
        outfile.write("{__iter}\t{__score}\t{__step}\t{__time}\t{__total}\tcatboost\n".format(__iter=best_iter,
                                                                                    __score=best,
                                                                                    __step=step,
                                                                                    __time=time_to_best,
                                                                                    __total=total_iters))