BotBase/modules/antiflood.py
def is_flood(updates: list):
    """
    Calculates if a sequence of
    updates corresponds to a flood
    """

    genexpr = [i <= ANTIFLOOD_SENSIBILITY for i in
               ((updates[i + 1] - timestamp) if i < (MAX_UPDATE_THRESHOLD - 1) else (timestamp - updates[i - 1]) for
                i, timestamp in enumerate(updates))]
    return sum(genexpr) >= int((len(genexpr) / 100) * FLOOD_PERCENTAGE)

    Calculates if a sequence of
    updates corresponds to a flood
    
Calculates if a sequence of
updates corresponds to a flood
Calculates if a sequence of updates corresponds to a flood
def is_flood(updates: list):
    genexpr = [i <= ANTIFLOOD_SENSIBILITY for i in
               ((updates[i + 1] - timestamp) if i < (MAX_UPDATE_THRESHOLD - 1) else (timestamp - updates[i - 1]) for
                i, timestamp in enumerate(updates))]
    return sum(genexpr) >= int((len(genexpr) / 100) * FLOOD_PERCENTAGE)
def is_flood ( updates : list ) : genexpr = [ i <= ANTIFLOOD_SENSIBILITY for i in ( ( updates [ i + 1 ] - timestamp ) if i < ( MAX_UPDATE_THRESHOLD - 1 ) else ( timestamp - updates [ i - 1 ] ) for i , timestamp in enumerate ( updates ) ) ] return sum ( genexpr ) >= int ( ( len ( genexpr ) / 100 ) * FLOOD_PERCENTAGE )
Calculates if a sequence of
updates corresponds to a flood
Calculates if a sequence of updates corresponds to a flood
"""
    Calculates if a sequence of
    updates corresponds to a flood
    """
updates
list