<commit_before># coding=utf-8
import random
import logging
from pycolo import UpperLayer


class AdverseLayer(UpperLayer):
    """
    This class describes the functionality of a layer that drops messages
    with a given probability in order to test retransmissions between
    MessageLayer and UDPLayer etc.
    """

    def __init__(self, txPacketLossProbability, rxPacketLossProbability):
        """ generated source for method __init__ """
        super(AdverseLayer, self).__init__()
        self.txPacketLossProbability = txPacketLossProbability
        self.rxPacketLossProbability = rxPacketLossProbability

    def __init___0(self):
        """ generated source for method __init___0 """
        super(AdverseLayer, self).__init__()
        self.__init__(0.01, 0.00)

    def doSendMessage(self, msg):
        """ generated source for method doSendMessage """
        if random.SystemRandom() >= self.txPacketLossProbability:
            self.sendMessageOverLowerLayer(msg)
        else:
            logging.info("[%s] Outgoing message dropped: %s\n" % self.getClass().__name__, msg.key())

    def doReceiveMessage(self, msg):
        """ generated source for method doReceiveMessage """
        if random.SystemRandom() >= self.rxPacketLossProbability:
            self.deliverMessage(msg)
        else:
            logging.info("[%s] Incoming message dropped: %s\n", self.getClass().__name__, msg.key())

    txPacketLossProbability = float()
    rxPacketLossProbability = float()<commit_msg>Corrections et paramètres par défaut<commit_after># coding=utf-8
import random
import logging
from pycolo import UpperLayer


class AdverseLayer(UpperLayer):
    """
    This class describes the functionality of a layer that drops messages
    with a given probability in order to test retransmissions between
    MessageLayer and UDPLayer etc.
    """

    def __init__(self, txPacketLossProbability=0.0, rxPacketLossProbability=0.0):
        self.txPacketLossProbability = txPacketLossProbability
        self.rxPacketLossProbability = rxPacketLossProbability

    def doSendMessage(self, msg):
        if random.SystemRandom() >= self.txPacketLossProbability:
            self.sendMessageOverLowerLayer(msg)
        else:
            logging.info("[%s] Outgoing message dropped: %s\n" % self.getClass().__name__, msg.key())

    def doReceiveMessage(self, msg):
        if random.SystemRandom() >= self.rxPacketLossProbability:
            self.deliverMessage(msg)
        else:
            logging.info("[%s] Incoming message dropped: %s\n", self.getClass().__name__, msg.key())
{'fraction_non_alphanumeric': 0.0946676970633694, 'fraction_numerical': 0.005409582689335394, 'mean_word_length': 3.373310810810811, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1167307', 'n_tokens_mistral': 744, 'n_tokens_neox': 700, 'n_words': 185}