# Path: xcessiv/functions.py
# def hash_file(path, block_size=65536):
# def hash_string(string):
# def import_object_from_path(path, object):
# def import_object_from_string_code(code, object):
# def import_string_code_as_module(code):
# def verify_dataset(X, y):
# def is_valid_json(x):
# def make_serializable(json):
# def get_sample_dataset(dataset_properties):
# def verify_estimator_class(est, meta_feature_generator, metric_generators, dataset_properties):
# def get_path_from_query_string(req):
#     def __init__(self, path):
#     def __enter__(self):
#     def __exit__(self, exc_type, exc_val, exc_tb):
# class DBContextManager():
# 
# Path: xcessiv/exceptions.py
# class UserError(Exception):
#     def __init__(self, message, status_code=400, **kwargs):
#     def to_dict(self):
#     def __repr__(self):


import unittest
import os
import numpy as np
import pickle
from xcessiv import functions, exceptions
from sklearn.datasets import load_digits
from sklearn.ensemble import RandomForestClassifier
from sklearn.decomposition import PCA
from sklearn.pipeline import Pipeline
        self.dataset_properties['n_classes'] = 4
        self.dataset_properties['n_informative'] = 18
        X, y, split = functions.get_sample_dataset(self.dataset_properties)
        assert X.shape == (100, 20)
        assert y.shape == (100,)
        assert len(np.unique(y)) == 4

        self.dataset_properties['n_features'] = 100
        X, y, split = functions.get_sample_dataset(self.dataset_properties)
        assert X.shape == (100, 100)
        assert y.shape == (100,)
        assert len(np.unique(y)) == 4

        self.dataset_properties['n_samples'] = 24
        X, y, split = functions.get_sample_dataset(self.dataset_properties)
        assert X.shape == (24, 100)
        assert y.shape == (24,)
        assert len(np.unique(y)) == 4

    def test_iris_dataset(self):
        X, y, split = functions.get_sample_dataset({'type': 'iris'})
        assert X.shape == (150, 4)
        assert y.shape == (150,)

    def test_mnist_dataset(self):
        X, y, split = functions.get_sample_dataset({'type': 'mnist'})
        assert X.shape == (1797, 64)
        assert y.shape == (1797,)

    def test_breast_cancer_dataset(self):

# Path: xcessiv/functions.py
# def hash_file(path, block_size=65536):
# def hash_string(string):
# def import_object_from_path(path, object):
# def import_object_from_string_code(code, object):
# def import_string_code_as_module(code):
# def verify_dataset(X, y):
# def is_valid_json(x):
# def make_serializable(json):
# def get_sample_dataset(dataset_properties):
# def verify_estimator_class(est, meta_feature_generator, metric_generators, dataset_properties):
# def get_path_from_query_string(req):
#     def __init__(self, path):
#     def __enter__(self):
#     def __exit__(self, exc_type, exc_val, exc_tb):
# class DBContextManager():
# 
# Path: xcessiv/exceptions.py
# class UserError(Exception):
#     def __init__(self, message, status_code=400, **kwargs):
#     def to_dict(self):
#     def __repr__(self):


# Path: xcessiv/tests/test_functions.py
import unittest
import os
import numpy as np
import pickle
from xcessiv import functions, exceptions
from sklearn.datasets import load_digits
from sklearn.ensemble import RandomForestClassifier
from sklearn.decomposition import PCA
from sklearn.pipeline import Pipeline

        self.dataset_properties['n_classes'] = 4
        self.dataset_properties['n_informative'] = 18
        X, y, split = functions.get_sample_dataset(self.dataset_properties)
        assert X.shape == (100, 20)
        assert y.shape == (100,)
        assert len(np.unique(y)) == 4

        self.dataset_properties['n_features'] = 100
        X, y, split = functions.get_sample_dataset(self.dataset_properties)
        assert X.shape == (100, 100)
        assert y.shape == (100,)
        assert len(np.unique(y)) == 4

        self.dataset_properties['n_samples'] = 24
        X, y, split = functions.get_sample_dataset(self.dataset_properties)
        assert X.shape == (24, 100)
        assert y.shape == (24,)
        assert len(np.unique(y)) == 4

    def test_iris_dataset(self):
        X, y, split = functions.get_sample_dataset({'type': 'iris'})
        assert X.shape == (150, 4)
        assert y.shape == (150,)

    def test_mnist_dataset(self):
        X, y, split = functions.get_sample_dataset({'type': 'mnist'})
        assert X.shape == (1797, 64)
        assert y.shape == (1797,)

    def test_breast_cancer_dataset(self):

        X, y, split = functions.get_sample_dataset({'type': 'breast_cancer'})