I am not sure what the goal of this check is (the docstring does tell me
all the shapes possible in the list of labels). However, it is a very
weak test: what if I pass in an ndarray and a memmap? Also, a list is a
valid array-like, and we tend to expect code to behave right for lists.

I am not sure if it would solve your usecase, but could you simply
convert both inputs to ndarrays, using np.asarray, and test for their
shape/dimension? Judging by the discussion, I have the impression that
you want something more flexible, but I don't understand how it would
work/what would be the purpose (examples in the docstring are great for
these purposes).