# Path: sacred/serializer.py
# def flatten(obj):
#     return _json.loads(json.encode(obj, keys=True))
# 
# def restore(flat):
#     return json.decode(_json.dumps(flat), keys=True)


import pytest
import sacred.optional as opt
from sacred.serializer import flatten, restore
    "obj",
    [
        12,
        3.14,
        "mystring",
        "αβγδ",
        [1, 2.0, "3", [4]],
        {"foo": "bar", "answer": 42},
        None,
        True,
    ],
)
def test_flatten_on_json_is_noop(obj):
    assert flatten(obj) == obj


@pytest.mark.parametrize(
    "obj",
    [
        12,
        3.14,
        "mystring",
        "αβγδ",
        [1, 2.0, "3", [4]],
        {"foo": "bar", "answer": 42},
        None,
        True,
    ],
)
def test_restore_on_json_is_noop(obj):

# Path: sacred/serializer.py
# def flatten(obj):
#     return _json.loads(json.encode(obj, keys=True))
# 
# def restore(flat):
#     return json.decode(_json.dumps(flat), keys=True)


# Path: tests/test_serializer.py
import pytest
import sacred.optional as opt
from sacred.serializer import flatten, restore

    "obj",
    [
        12,
        3.14,
        "mystring",
        "αβγδ",
        [1, 2.0, "3", [4]],
        {"foo": "bar", "answer": 42},
        None,
        True,
    ],
)
def test_flatten_on_json_is_noop(obj):
    assert flatten(obj) == obj


@pytest.mark.parametrize(
    "obj",
    [
        12,
        3.14,
        "mystring",
        "αβγδ",
        [1, 2.0, "3", [4]],
        {"foo": "bar", "answer": 42},
        None,
        True,
    ],
)
def test_restore_on_json_is_noop(obj):

    assert flatten(obj) == obj