def dup_idx(arr):
_, b = np.unique(arr, return_inverse=True)<EOL>return np.nonzero(np.logical_or.reduce(<EOL>b[:, np.newaxis] == np.nonzero(np.bincount(b) > <NUM_LIT:1>),<EOL>axis=<NUM_LIT:1>))[<NUM_LIT:0>]<EOL>
Return the indices of all duplicated array elements.

    Parameters
    ----------
    arr : array-like object
        An array-like object

    Returns
    -------
    idx : NumPy array
        An array containing the indices of the duplicated elements

    Examples
    --------
    >>> from root_numpy import dup_idx
    >>> dup_idx([1, 2, 3, 4, 5])
    array([], dtype=int64)
    >>> dup_idx([1, 2, 3, 4, 5, 5])
    array([4, 5])
    >>> dup_idx([1, 2, 3, 4, 5, 5, 1])
    array([0, 4, 5, 6])