def get_tabular_stat_str(task_vals):
    """assume subdir is <param>/run_*/0"""
    msg = ""
    for task in [task for task in TASKS if task in task_vals]:
        msg += f"=== {task}\n"
        param_to_runs = defaultdict(dict)
        for subdir in task_vals[task]:
            match = re.match("(.*)/(run_.*)/0", subdir)
            assert match, "subdir"
            param, run = match.groups()
            param_to_runs[param][run] = task_vals[task][subdir]
        params = sorted(param_to_runs, key=lambda x: float(x))
        runs = sorted(set(run for runs in param_to_runs.values() for run in runs))
        msg += ("runs:" + "\t".join(runs) + "\n")
        msg += ("params:" + "\t".join(params) + "\n")
        for param in params:
            msg += "\t".join([str(param_to_runs[param].get(run, None)) for run in runs])
            msg += "\n"
        # for subdir in sorted(task_vals[task].keys()):
        #     msg += f"\t{subdir}\t{task_vals[task][subdir]}\n"
    return msg
assume subdir is <param>/run_*/0
examples/data2vec/scripts/text/glue_lr.py