def get_roi_counts(self, roi, net=False):
        """get counts for an roi"""
        thisroi = None
        if isinstance(roi, ROI):
            thisroi = roi
        elif isinstance(roi, int) and len(self.rois) < roi:
            thisroi = self.rois[roi]
        elif isinstance(roi, (str, unicode)):
            rnames = [r.name.lower() for r in self.rois]
            for iroi, nam in enumerate(rnames):
                if nam.startswith(roi.lower()):
                    thisroi = self.rois[iroi]
                    break
        if thisroi is None:
            return None
        return thisroi.get_counts(self.counts, net=net)
dataset/ETHPy150Open xraypy/xraylarch/plugins/xrf/mca.py/MCA.get_roi_counts/swapped operands of `<`