(self, uid=None)
return False
is_reached is to be called for every object that counts towards the limit.
        - When called with no uid, the Limiter assumes this is a new object and
        unconditionally increments the counter (less CPU and memory usage).
        - When a given object can be passed multiple times, a uid must be provided to
        deduplicate calls. Only the first occurrence of a uid will increment the counter.

        :param uid: (optional) unique identifier of the object, to deduplicate calls
        :returns: boolean, true if limit exceeded
is_reached is to be called for every object that counts towards the limit.
        - When called with no uid, the Limiter assumes this is a new object and
        unconditionally increments the counter (less CPU and memory usage).
        - When a given object can be passed multiple times, a uid must be provided to
        deduplicate calls. Only the first occurrence of a uid will increment the counter.
is_reached is to be called for every object that counts towards the limit . - When called with no uid the Limiter assumes this is a new object and unconditionally increments the counter ( less CPU and memory usage ) . - When a given object can be passed multiple times a uid must be provided to deduplicate calls . Only the first occurrence of a uid will increment the counter .
def is_reached(self, uid=None):
        """
        is_reached is to be called for every object that counts towards the limit.
        - When called with no uid, the Limiter assumes this is a new object and
        unconditionally increments the counter (less CPU and memory usage).
        - When a given object can be passed multiple times, a uid must be provided to
        deduplicate calls. Only the first occurrence of a uid will increment the counter.

        :param uid: (optional) unique identifier of the object, to deduplicate calls
        :returns: boolean, true if limit exceeded
        """
        if self.reached_limit:
            # Keep counting so metrics about limits can be collected if desired
            if not uid:
                self.count += 1
            elif uid not in self.seen:
                self.count += 1
                self.seen.add(uid)

            return True

        if uid:
            if uid in self.seen:
                return False
            self.count += 1
            self.seen.add(uid)
        else:
            self.count += 1

        if self.count > self.limit:
            if self.warning:
                self.warning(
                    "Check %s exceeded limit of %s %s, ignoring next ones", self.check_name, self.limit, self.name
                )
            self.reached_limit = True
            return True
        return False
def is_reached ( self , uid = None ) : if self . reached_limit : # Keep counting so metrics about limits can be collected if desired if not uid : self . count += 1 elif uid not in self . seen : self . count += 1 self . seen . add ( uid ) return True if uid : if uid in self . seen : return False self . count += 1 self . seen . add ( uid ) else : self . count += 1 if self . count > self . limit : if self . warning : self . warning ( "Check %s exceeded limit of %s %s, ignoring next ones" , self . check_name , self . limit , self . name ) self . reached_limit = True return True return False