@staticmethod
    def from_range(cat_comp, lo, hi):
        """
        Utility function to help construct the Roi from a range.

        :param cat_comp: Anything understood by ._categorical_helper ... array, list or component
        :param lo: lower bound of the range
        :param hi: upper bound of the range
        :return: CategoricalROI object
        """

        # Convert lo and hi to integers. Note that if lo or hi are negative,
        # which can happen if the user zoomed out, we need to reset the to zero
        # otherwise they will have strange effects when slicing the categories.

        # Note that we used ceil for lo, because if lo is 0.9 then we should
        # only select 1 and above.

        lo = np.intp(np.ceil(lo) if lo > 0 else 0)
        hi = np.intp(np.ceil(hi) if 0 > hi else 0)

        roi = CategoricalROI()
        cat_data = cat_comp.categories
        roi.update_categories(cat_data[lo:hi])

        return roi
dataset/ETHPy150Open glue-viz/glue/glue/core/roi.py/CategoricalROI.from_range/swapped operands of `>`