# Path: automlk/dataset.py
# def get_dataset_list(include_results=False):
#     """
#     get the list of all datasets
# 
#     :param include_results: flag to determine if the status are also retrieved (default = False)
#     :return: list of datasets objects or empty list if error (eg. redis or environment not set)
#     """
#     # try:
#     return [get_dataset(dataset_id, include_results) for dataset_id in get_dataset_ids()]
#     # except:
#     #    return []
# 
# Path: automlk/store.py
# def get_key_store(key):
#     """
#     retieves value from key in store
# 
#     :param key: key of the data
#     :return: value of the data
#     """
#     if get_use_redis():
#         return json.loads(rds.get(str(key)))
#     else:
#         try:
#             if exists_key_store(key):
#                 return json.load(open(store_folder + '/' + __clean_key(key) + '.json', 'r'))
#             else:
#                 return None
#         except:
#             return None
# 
# Path: automlk/solutions_pp.py
# PP_CATEGORIES = ['missing', 'categorical', 'float', 'date', 'text', 'scaling', 'feature']
# class PpSolution(object):
#     def __init__(self, ref, name, process, default_params, space_params, pp_type, selectable=True, limit_size=1e32,
#                  problem_type='*'):


from automlk.dataset import get_dataset_list
from automlk.store import get_key_store
from automlk.solutions_pp import pp_solutions_map

"""
update pipeline codes in results with new pre-processing codes
"""

missing = []

for dt in get_dataset_list():
    print('-'*60)
    print(dt.name)

    res = get_key_store('dataset:%s:rounds' % dt.dataset_id)
    if res is not None:
        for r in res:
            for p in r['pipeline']:

# Path: automlk/dataset.py
# def get_dataset_list(include_results=False):
#     """
#     get the list of all datasets
# 
#     :param include_results: flag to determine if the status are also retrieved (default = False)
#     :return: list of datasets objects or empty list if error (eg. redis or environment not set)
#     """
#     # try:
#     return [get_dataset(dataset_id, include_results) for dataset_id in get_dataset_ids()]
#     # except:
#     #    return []
# 
# Path: automlk/store.py
# def get_key_store(key):
#     """
#     retieves value from key in store
# 
#     :param key: key of the data
#     :return: value of the data
#     """
#     if get_use_redis():
#         return json.loads(rds.get(str(key)))
#     else:
#         try:
#             if exists_key_store(key):
#                 return json.load(open(store_folder + '/' + __clean_key(key) + '.json', 'r'))
#             else:
#                 return None
#         except:
#             return None
# 
# Path: automlk/solutions_pp.py
# PP_CATEGORIES = ['missing', 'categorical', 'float', 'date', 'text', 'scaling', 'feature']
# class PpSolution(object):
#     def __init__(self, ref, name, process, default_params, space_params, pp_type, selectable=True, limit_size=1e32,
#                  problem_type='*'):


# Path: scripts/update_results.py
from automlk.dataset import get_dataset_list
from automlk.store import get_key_store
from automlk.solutions_pp import pp_solutions_map


"""
update pipeline codes in results with new pre-processing codes
"""

missing = []

for dt in get_dataset_list():
    print('-'*60)
    print(dt.name)

    res = get_key_store('dataset:%s:rounds' % dt.dataset_id)
    if res is not None:
        for r in res:
            for p in r['pipeline']:

                if p[0] not in pp_solutions_map: