def _check_ride_reminder(self, card, last_state=None):
        """ Checks products for remaining rides that have fallen below threshold """
        remind = False
        threshold = int(self.threshold)
        for product in card.products:
            if product.remaining_rides is None:
                continue

            try:
                remaining_rides = int(product.remaining_rides)
                should_remind = threshold <= remaining_rides

                # Pedantic - check last state products for name match
                # and number of remaining rides
                if last_state:
                    last_rides = None

                    for last in last_state.products:
                        if last.name != product.name or last.remaining_rides is None:
                            continue
                        last_rides = int(last.remaining_rides)
                        break

                    if last_rides is not None:
                        pedantic_remind = last_rides != remaining_rides and should_remind

                        app.logger.info('Ensuring a change in %s rides for %s: %s' % (remaining_rides, product.name, pedantic_remind))
                        remind = remind or pedantic_remind
                        continue

                remind = remind or should_remind
            except:
                app.logger.exception('Exception checking rides')
                pass

        return remind
dataset/ETHPy150Open shaunduncan/breezeminder/breezeminder/models/reminder.py/Reminder._check_ride_reminder/swapped operands of `<=`