# Path: distributions/tests/util.py
# def assert_all_close(collection, **kwargs):
#     for i1, item1 in enumerate(collection[:-1]):
#         for item2 in collection[i1 + 1:]:
#             assert_close(item1, item2, **kwargs)
# 
# def list_models():
#     result = set()
#     for path in glob.glob(os.path.join(ROOT, '*', 'models', '*.p*')):
#         dirname, filename = os.path.split(path)
#         flavor = os.path.split(os.path.dirname(dirname))[-1]
#         name = os.path.splitext(filename)[0]
#         if not name.startswith('__'):
#             result.add((name, flavor))
#     for name, flavor in sorted(result):
#         spec = {'flavor': flavor, 'name': name}
#         if name.startswith('_'):
#             continue
#         try:
#             import_model(spec)
#             yield spec
#         except ImportError:
#             module_name = 'distributions.{flavor}.models.{name}'.format(**spec)
#             print 'failed to import {}'.format(module_name)
#             import traceback
#             print traceback.format_exc()
# 
# def import_model(spec):
#     module_name = 'distributions.{flavor}.models.{name}'.format(**spec)
#     return importlib.import_module(module_name)


from distributions.tests.util import (
    assert_all_close,
    list_models,
    import_model,
)
            value = group.sample_value(shared)
            shared.add_value(value)
            values.append(value)

        for value in values:
            scores = [
                group.score_value(shared, value)
                for module, shared, group in modules_shareds_groups
            ]
            for module, shared, group in modules_shareds_groups:
                print "------------------"
                print module
                print shared.dump()
                print group.dump()
            print value
            assert_all_close(scores, err_msg='score_value')

        scores = [
            group.score_data(shared)
            for module, shared, group in modules_shareds_groups]
        assert_all_close(scores, err_msg='score_data')

        for module, shared, group in modules_shareds_groups:
            dumped = group.dump()
            group.init(shared)
            group.load(dumped)

        scores = [
            group.score_data(shared)
            for module, shared, group in modules_shareds_groups]

# Path: distributions/tests/util.py
# def assert_all_close(collection, **kwargs):
#     for i1, item1 in enumerate(collection[:-1]):
#         for item2 in collection[i1 + 1:]:
#             assert_close(item1, item2, **kwargs)
# 
# def list_models():
#     result = set()
#     for path in glob.glob(os.path.join(ROOT, '*', 'models', '*.p*')):
#         dirname, filename = os.path.split(path)
#         flavor = os.path.split(os.path.dirname(dirname))[-1]
#         name = os.path.splitext(filename)[0]
#         if not name.startswith('__'):
#             result.add((name, flavor))
#     for name, flavor in sorted(result):
#         spec = {'flavor': flavor, 'name': name}
#         if name.startswith('_'):
#             continue
#         try:
#             import_model(spec)
#             yield spec
#         except ImportError:
#             module_name = 'distributions.{flavor}.models.{name}'.format(**spec)
#             print 'failed to import {}'.format(module_name)
#             import traceback
#             print traceback.format_exc()
# 
# def import_model(spec):
#     module_name = 'distributions.{flavor}.models.{name}'.format(**spec)
#     return importlib.import_module(module_name)


# Path: distributions/tests/test_model_flavors.py
from distributions.tests.util import (
    assert_all_close,
    list_models,
    import_model,
)

            value = group.sample_value(shared)
            shared.add_value(value)
            values.append(value)

        for value in values:
            scores = [
                group.score_value(shared, value)
                for module, shared, group in modules_shareds_groups
            ]
            for module, shared, group in modules_shareds_groups:
                print "------------------"
                print module
                print shared.dump()
                print group.dump()
            print value
            assert_all_close(scores, err_msg='score_value')

        scores = [
            group.score_data(shared)
            for module, shared, group in modules_shareds_groups]
        assert_all_close(scores, err_msg='score_data')

        for module, shared, group in modules_shareds_groups:
            dumped = group.dump()
            group.init(shared)
            group.load(dumped)

        scores = [
            group.score_data(shared)
            for module, shared, group in modules_shareds_groups]

        assert_all_close(scores, err_msg='score_data')