<commit_before>from .distributions import Exponential
from .math import inf
from .random_processes import RandomProcess, TimeIndex

class PoissonProcess(RandomProcess):

    def __init__(self, rate):
        self.rate = rate
        self.probSpace = Exponential(rate=rate) ** inf
        self.timeIndex = TimeIndex(fs=inf)
        def fun(x, t):
            n = 0
            total_time = 0
            while True:
                total_time += x[n]
                if total_time > t:
                    break
                else:
                    n += 1
            return n
        self.fun = fun<commit_msg>adding arrival and interarrival times for Poisson process<commit_after>from .distributions import Exponential
from .math import inf
from .random_processes import RandomProcess, TimeIndex

class PoissonProcess(RandomProcess):

    def __init__(self, rate):
        self.rate = rate
        self.probSpace = Exponential(rate=rate) ** inf
        self.timeIndex = TimeIndex(fs=inf)
        def fun(x, t):
            n = 0
            total_time = 0
            while True:
                total_time += x[n]
                if total_time > t:
                    break
                else:
                    n += 1
            return n
        self.fun = fun

    def ArrivalTimes(self):
        def fun(x, t):
            total = 0
            for i in range(t):
                total += x[i]
            return total
        return RandomProcess(self.probSpace, TimeIndex(1), fun)

    def InterarrivalTimes(self):
        def fun(x, t):
            return x[t]
        return RandomProcess(self.probSpace, TimeIndex(1), fun)
{'fraction_non_alphanumeric': 0.07912355447352404, 'fraction_numerical': 0.005477784540474742, 'mean_word_length': 1.5768025078369905, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '2240967', 'n_tokens_mistral': 460, 'n_tokens_neox': 431, 'n_words': 130}