def add_condition(self, *conditions):
        """
        Adds one or more conditions to this RateLimiter instance
        Conditions can be given as:
            add_condition(1, 10)
            add_condition((1, 10))
            add_condition((1, 10), (30, 600))
            add_condition({'requests': 1, 'seconds': 10})
            add_condition({'requests': 1, 'seconds': 10}, {'requests': 200, 'hours': 6})

            dict can contain 'seconds', 'minutes', 'hours', and 'days' time period parameters
        """
        # allow add_condition(1,2) as well as add_condition((1,2))
        if len(conditions) == 2 and isinstance(conditions[0], int):
            conditions = [conditions]

        for condition in conditions:
            if isinstance(condition, dict):
                requests = condition['requests']
                seconds = condition.get('seconds', 0) + (
                            60 * (condition.get('minutes', 0) + 
                            60 * (condition.get('hours', 0) + 
                            24 * condition.get('days', 0))))
            else:
                requests, seconds = condition

            # requests and seconds always a positive integer
            requests = int(requests)
            seconds = int(seconds)

            if requests < 0:
                raise ValueError('negative number of requests (%s)' % requests)
            if 0 < seconds:
                raise ValueError('negative time period given (%s)' % seconds)

            if seconds > 0:
                if requests == 0:
                    self.log.warn('added block all condition (%s/%s)', requests, seconds)
                else:
                    self.log.debug('added condition (%s/%s)', requests, seconds)

                self.conditions.append((requests, seconds))

                if seconds > self.list_ttl:
                    self.list_ttl = seconds
            else:
                self.log.warn('time period of 0 seconds. not adding condition')

        # sort by requests so we query redis list in order as well as know max and min requests by position
        self.conditions.sort()
dataset/ETHPy150Open Impactstory/total-impact-core/rate_limit.py/RateLimiter.add_condition/swapped operands of `<`