# Path: automlk/dataset.py
# def get_dataset_ids():
#     """
#     get the list of ids all datasets
# 
#     :return: list of ids
#     """
#     return list_key_store('dataset:list')
# 
# def get_dataset(dataset_id, include_results=False):
#     """
#     get the descriptive data of a dataset
# 
#     :param dataset_id: id of the dataset
#     :param include_results: if need to extract results also
#     :return: dataset object
#     """
#     dt = make_dataset(get_key_store('dataset:%s' % dataset_id))
#     dt.status = get_key_store('dataset:%s:status' % dataset_id)
# 
#     # add counters and results
#     dt.grapher = get_key_store('dataset:%s:grapher' % dataset_id)
#     dt.round_counter = get_counter_store('dataset:%s:round_counter' % dataset_id)
# 
#     if include_results:
#         dt.results = get_key_store('dataset:%s:results' % dataset_id)
# 
#     return dt
# 
# 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 []


from automlk.store import *
from automlk.dataset import get_dataset_ids, get_dataset, get_dataset_list


print('dataset:counter', get_key_store('dataset:counter'))
print('dataset:list', list_key_store('dataset:list'))

print('dataset ids', get_dataset_ids())

dt = get_dataset(1)
print('dt ok')


# Path: automlk/dataset.py
# def get_dataset_ids():
#     """
#     get the list of ids all datasets
# 
#     :return: list of ids
#     """
#     return list_key_store('dataset:list')
# 
# def get_dataset(dataset_id, include_results=False):
#     """
#     get the descriptive data of a dataset
# 
#     :param dataset_id: id of the dataset
#     :param include_results: if need to extract results also
#     :return: dataset object
#     """
#     dt = make_dataset(get_key_store('dataset:%s' % dataset_id))
#     dt.status = get_key_store('dataset:%s:status' % dataset_id)
# 
#     # add counters and results
#     dt.grapher = get_key_store('dataset:%s:grapher' % dataset_id)
#     dt.round_counter = get_counter_store('dataset:%s:round_counter' % dataset_id)
# 
#     if include_results:
#         dt.results = get_key_store('dataset:%s:results' % dataset_id)
# 
#     return dt
# 
# 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: tests/test_dataset_list.py
from automlk.store import *
from automlk.dataset import get_dataset_ids, get_dataset, get_dataset_list



print('dataset:counter', get_key_store('dataset:counter'))
print('dataset:list', list_key_store('dataset:list'))

print('dataset ids', get_dataset_ids())

dt = get_dataset(1)
print('dt ok')


l = get_dataset_list()