def equalspairs(X, Y):
T = Y.copy()<EOL>R = (T[<NUM_LIT:1>:] != T[:-<NUM_LIT:1>]).nonzero()[<NUM_LIT:0>]<EOL>R = np.append(R,np.array([len(T)-<NUM_LIT:1>]))<EOL>M = R[R.searchsorted(range(len(T)))]<EOL>D = T.searchsorted(X)<EOL>T = np.append(T,np.array([<NUM_LIT:0>]))<EOL>M = np.append(M,np.array([<NUM_LIT:0>]))<EOL>A = (T[D] == X) * D<EOL>B = (T[D] == X) * (M[D] + <NUM_LIT:1>)<EOL>return [A,B]<EOL>
Indices of elements in a sorted numpy array equal to those in another.

Given numpy array `X` and sorted numpy array `Y`, determine the indices in 
Y equal to indices in X.

Returns `[A,B]` where `A` and `B` are numpy arrays of indices in `X` such 
that::

        Y[A[i]:B[i]] = Y[Y == X[i]]`

`A[i] = B[i] = 0` if `X[i]` is not in `Y`.

**Parameters**

        **X** :  numpy array

                Numpy array to compare to the sorted numpy array `Y`.

        **Y** :  numpy array

                Sorted numpy array.  Determine the indices of elements of 
                `Y` equal to those in numpy array `X`.

**Returns**

        **A** :  numpy array

                List of indices in `Y`, `len(A) = len(Y)`.

        **B** :  numpy array

                List of indices in `Y`, `len(B) = len(Y)`.

**See Also:**

        :func:`tabular.fast.recarrayequalspairs`