def METHOD_NAME(space):
    """Tests roundtripping with flattening and unflattening are equal to the original sample."""
    samples = [space.sample() for _ in range(10)]
    flattened_samples = [utils.flatten(space, sample) for sample in samples]
    unflattened_samples = [
        utils.unflatten(space, sample) for sample in flattened_samples
    ]
    for original, roundtripped in zip(samples, unflattened_samples):
        assert data_equivalence(original, roundtripped)