def METHOD_NAME(device, batch_size, layout, shape, dtype, dictionary_type,
                                    default_value):
    eii1 = RandomlyShapedDataIterator(batch_size, max_shape=shape)
    eii2 = RandomlyShapedDataIterator(batch_size, max_shape=shape)
    if dictionary_type == 'empty':
        dictionary = {}
    elif dictionary_type == 'random':
        dictionary = {k: random.random() for k in range(256)}
    elif dictionary_type == 'small':
        dictionary = {0: 0.1, 200: 0.99}
    else:
        assert False
    compare_pipelines(
        LookupTablePipeline(device, batch_size, iter(eii1), data_shape=shape, data_layout=layout,
                            dtype=dtype, dictionary=dictionary, default_value=default_value),
        LookupTablePythonOpPipeline(lookup_func, batch_size, iter(eii2), data_shape=shape,
                                    data_layout=layout, dtype=dtype, dictionary=dictionary,
                                    default_value=default_value),
        batch_size=batch_size, N_iterations=3)