def METHOD_NAME(lt_ctx, tileshape, udf_clss):
    data = _mk_random(size=(16, 16, 16, 16))
    bad_ds = BadMemoryDS(
        data=data,
        tileshape=tileshape,
        num_partitions=2,
        sig_dims=2
    )
    ds = MemoryDataSet(
        data=data,
        tileshape=tileshape,
        num_partitions=2,
        sig_dims=2
    )
    for udf_cls in udf_clss:
        _ = lt_ctx.run_udf(dataset=ds, udf=udf_cls())
        with pytest.raises(Exception) as exc_info:
            _ = lt_ctx.run_udf(dataset=bad_ds, udf=udf_cls())
        assert exc_info.errisinstance((AssertionError, IndexError))