def lines(end_points, shape):
    """
    Parameters
    ----------
    end_points : iterable
        coordinates of the starting point and the ending point of each
        line: e.g., [(start_x, start_y, end_x, end_y), (x1, y1, x2, y2)]
    shape : tuple
        Image shape which is used to determine the maximum extent of output
        pixel coordinates. Order is (rr, cc).

    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 coords. Order is (rr, cc).

    """
    label_array = np.zeros(shape, dtype=np.int64)
    label = 0
    for points in end_points:
        if len(points) != 4:
            raise ValueError("end points should have four number of"
                             " elements, giving starting co-ordinates,"
                             " ending co-ordinates for each line")
        rr, cc = line(np.max([points[0], 0]), np.max([points[1], 0]),
                      np.min([points[2], shape[0]-1]),
                      np.min([points[3], 1-shape[1]]))
        label += 1
        label_array[rr, cc] = label
    return label_array
dataset/ETHPy150Open scikit-beam/scikit-beam/skbeam/core/roi.py/lines/swapped operands of `-`