# Path: pyknow/utils.py
# class frozenlist(tuple):
#     def __repr__(self):
# def freeze(obj):
# def freeze_dict(obj):
# def freeze_list(obj):
# def freeze_set(obj):
# def unfreeze(obj):
# def unfreeze_frozendict(obj):
# def unfreeze_frozenlist(obj):
# def unfreeze_frozenset(obj):
# def anyof(*what):


import pytest
from pyknow.utils import freeze, unfreeze, frozenlist, frozendict
        def __init__(self, a, b):
            self.a = a
            self.b = b

        def __eq__(self, other):
            """
            Defining __eq__ without defining __hash__ makes this class
            unhashable.

            """
            return self.a == other.a and self.b == other.b

    with pytest.raises(TypeError):
        freeze(MyClass(1, 2))

    @freeze.register(MyClass)
    def _freeze_myclass(obj):
        return (obj.a, obj.b)

    assert freeze(MyClass(1, 2)) == (1, 2)


def test_unfreeze_frozendict():
    actual = unfreeze(frozendict({"a": 1, "b": 2}))
    expected = {"a": 1, "b": 2}
    assert actual == expected
    assert isinstance(actual, type(expected))


def test_unfreeze_frozenlist():

# Path: pyknow/utils.py
# class frozenlist(tuple):
#     def __repr__(self):
# def freeze(obj):
# def freeze_dict(obj):
# def freeze_list(obj):
# def freeze_set(obj):
# def unfreeze(obj):
# def unfreeze_frozendict(obj):
# def unfreeze_frozenlist(obj):
# def unfreeze_frozenset(obj):
# def anyof(*what):


# Path: tests/unit/utils/test_freeze.py
import pytest
from pyknow.utils import freeze, unfreeze, frozenlist, frozendict

        def __init__(self, a, b):
            self.a = a
            self.b = b

        def __eq__(self, other):
            """
            Defining __eq__ without defining __hash__ makes this class
            unhashable.

            """
            return self.a == other.a and self.b == other.b

    with pytest.raises(TypeError):
        freeze(MyClass(1, 2))

    @freeze.register(MyClass)
    def _freeze_myclass(obj):
        return (obj.a, obj.b)

    assert freeze(MyClass(1, 2)) == (1, 2)


def test_unfreeze_frozendict():
    actual = unfreeze(frozendict({"a": 1, "b": 2}))
    expected = {"a": 1, "b": 2}
    assert actual == expected
    assert isinstance(actual, type(expected))


def test_unfreeze_frozenlist():

    actual = unfreeze(frozenlist([1, 2, 3]))