<commit_before>import numpy as np

from bartpy.model import Model
from bartpy.node import LeafNode
from bartpy.samplers.sampler import Sampler


class LeafNodeSampler(Sampler):

    def __init__(self):
        self.random_samples = list(np.random.normal(size = 50000))

    def step(self, model: Model, node: LeafNode):
        node.set_value(self.sample(model, node))

    def get_next_rand(self):
        if len(self.random_samples) == 0:
            self.random_samples = list(np.random.normal(size = 50000))
        return self.random_samples.pop()

    def sample(self, model: Model, node: LeafNode) -> float:<commit_msg>Formatting<commit_after>import numpy as np

from bartpy.model import Model
from bartpy.node import LeafNode
from bartpy.samplers.sampler import Sampler


class LeafNodeSampler(Sampler):

    def __init__(self):
        self.random_samples = list(np.random.normal(size=50000))

    def step(self, model: Model, node: LeafNode):
        node.set_value(self.sample(model, node))

    def get_next_rand(self):
        if len(self.random_samples) == 0:
            self.random_samples = list(np.random.normal(size=50000))
        return self.random_samples.pop()

    def sample(self, model: Model, node: LeafNode) -> float:
{'fraction_non_alphanumeric': 0.10763052208835341, 'fraction_numerical': 0.017670682730923693, 'mean_word_length': 3.6319702602230484, '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': '7290620', 'n_tokens_mistral': 426, 'n_tokens_neox': 385, 'n_words': 93}