human
I wrote the below code

    layers = ([model.visible_layer] + model.hidden_layers)
    def check_batch_size(l):
        if isinstance(l, (list, tuple)):
            map(check_batch_size, l)
        else:
            assert (l.get_value().shape[0] == m)
    for layer in layers:
        state = layer_to_state[layer]
        space = layer.get_total_state_space()
        space.validate(state)
        if ('DenseMaxPool' in str(type(layer))):
            (p, h) = state
            p = p.get_value()
            h = h.get_value()
            assert np.all((p == h))
            assert is_binary(p)
        if ('BinaryVisLayer' in str(type(layer))):
            v = state.get_value()
            assert is_binary(v)
        if ('Softmax' in str(type(layer))):
            y = state.get_value()
            assert is_binary(y)
            s = y.sum(axis=1)
            assert np.all((s == 1))
        if ('Ising' in str(type(layer))):
            s = state.get_value()
            assert is_binary(((s + 1.0) / 2.0))

What's a good function header?
 Here's a good function header?
assistant
#Here's a good function header.

def validate_all_samples(model, layer_to_state):