"""This script  is for a mistake I made, and should not matter on the long run.
It is to save only 10 repetitions instead of 20 for newly made experiments
"""

import pickle
import config as co
import os

results_dir = "./results/"
file_list = os.listdir(results_dir)

for f in file_list:
    if "TraceNorm" in f or "OLS" in f:
        f_path = os.path.join(results_dir,f)
        with open(f_path, 'rb') as file:
            res_dict = pickle.load(file)
        res_dict["results"] = res_dict["results"][:,:10,:,:]
        with open(f_path[:-4]+"r10.pkl", "wb") as file:
            pickle.dump(res_dict, file)