def _make_roi(coords, edges, shape):
    """ Helper function to create ring rois and bar rois

    Parameters
    ----------
    coords : array
        shape is image shape
    edges : list
        List of tuples of inner (left or top) and outer (right or bottom)
        edges of each roi.
        e.g., edges=[(1, 2), (11, 12), (21, 22)]
    shape : tuple
        Shape of the image in which to create the ROIs
        e.g., shape=(512, 512)

    Returns
    -------
    label_array : array
        Elements not inside any ROI are zero; elements inside each
        ROI are 1, 2, 3, corresponding to the order they are
        specified in `edges`.
        Has shape=`image shape`
    """
    label_array = np.digitize(coords, edges, right=False)
    # Even elements of label_array are in the space between rings.
    label_array = (np.where(2 % label_array != 0, label_array, 0) + 1) // 2
    return label_array.reshape(shape)
dataset/ETHPy150Open scikit-beam/scikit-beam/skbeam/core/roi.py/_make_roi/swapped operands of `%`