<commit_before>import esn
import signals

SEED = 0
PATTERN_LENGTH = 1
PATTERN_PAUSE = 0.5
OUTPUT_PULSE_LENGTH = 0.2

class Signal :

    def __init__( self ) :
        self.value = 0
        self.time = 0
        self.front_edge = 0
        self.back_edge = 0
        self.pattern_noise = \
            signals.PerlinNoise( persistence=1, octave_count=7 )
        if SEED > 0 :
            self.pattern_noise.seed( SEED )
        self.pulse_noise = \
            signals.PerlinNoise( persistence=0.5, octave_count=1 )
        if SEED > 0 :
            self.pulse_noise.seed( SEED + 1 )
        self.prev_pulse_noise = self.pulse_noise( 0 )
        self.cur_pulse_noise = self.pulse_noise( 0 )

    def step( self, step ) :
        if self.time > ( self.front_edge + PATTERN_LENGTH + \
           PATTERN_PAUSE ) and self.is_front_edge() :
            self.front_edge = self.time
            self.back_edge = self.front_edge + PATTERN_LENGTH

        if self.front_edge <= self.time and \<commit_msg>samples : python : pattern : initialize Signal.back_edge<commit_after>import esn
import signals

SEED = 0
PATTERN_LENGTH = 1
PATTERN_PAUSE = 0.5
OUTPUT_PULSE_LENGTH = 0.2

class Signal :

    def __init__( self ) :
        self.value = 0
        self.time = 0
        self.front_edge = 0
        self.back_edge = -OUTPUT_PULSE_LENGTH
        self.pattern_noise = \
            signals.PerlinNoise( persistence=1, octave_count=7 )
        if SEED > 0 :
            self.pattern_noise.seed( SEED )
        self.pulse_noise = \
            signals.PerlinNoise( persistence=0.5, octave_count=1 )
        if SEED > 0 :
            self.pulse_noise.seed( SEED + 1 )
        self.prev_pulse_noise = self.pulse_noise( 0 )
        self.cur_pulse_noise = self.pulse_noise( 0 )

    def step( self, step ) :
        if self.time > ( self.front_edge + PATTERN_LENGTH + \
           PATTERN_PAUSE ) and self.is_front_edge() :
            self.front_edge = self.time
            self.back_edge = self.front_edge + PATTERN_LENGTH

        if self.front_edge <= self.time and \
{'fraction_non_alphanumeric': 0.09077669902912622, 'fraction_numerical': 0.018932038834951457, 'mean_word_length': 2.0308823529411764, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '2849926', 'n_tokens_mistral': 747, 'n_tokens_neox': 673, 'n_words': 144}