<commit_before># -*- coding: utf-8 -*-
from db.database import Database
from db.advicelog import Advice
from math import sqrt; from itertools import count, islice
import logging

class Experiment():
    
    def __init__(self, exp_id, key):
        self.db = Database()
        self.advice_db = Advice()
        self.exp_id = exp_id   # sets the experimentID
        self.properties = self.db.get_one_experiment(self.exp_id)
        self.key = key
        self.valid = False     # should be taken from Redis
    
    def is_valid(self):
        """Checks wheter the exp_id and key match for the current experiment.
        
        Input arguments:<commit_msg>#added default to constructor so its easy to create recursion \a = Experiment(2) self.action["test"] = "pizza" self.action["ExpName"] = a.properties<commit_after># -*- coding: utf-8 -*-
from db.database import Database
from db.advicelog import Advice
from math import sqrt; from itertools import count, islice
import logging

class Experiment():
         
    
    def __init__(self, exp_id, key = "notUsedForLoopBack"):
        self.db = Database()
        self.advice_db = Advice()
        self.exp_id = exp_id   # sets the experimentID
        self.properties = self.db.get_one_experiment(self.exp_id)
        self.key = key
        self.valid = False     # should be taken from Redis
    
    def is_valid(self):
        """Checks wheter the exp_id and key match for the current experiment.
        
        Input arguments:
{'fraction_non_alphanumeric': 0.08938172043010753, 'fraction_numerical': 0.0020161290322580645, 'mean_word_length': 2.640586797066015, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1166242', 'n_tokens_mistral': 439, 'n_tokens_neox': 435, 'n_words': 141}