How to check if an array is in another array in Python
You can do it this way:
([0, 40] == a).all(1).any()
The first step is to compute a 2D boolean array of where the matches are. Then you find the rows where all elements are true. Then you check if any rows are fully matching.