<commit_before>from transitions import Machine
import random

class TargetSite(object):

    states = ['cut', 'uncut']

    def __init__(self, sequence):

        self.sequence = sequence

        self.calculate_probability()

        # Initialize the state machine
        self.machine = Machine(model=self, states=TargetSite.states, initial='uncut')

        # add some transitions. We could also define these using a static list of 
        # dictionaries and then pass the list to 
        # the Machine initializer as the transitions= argument.

        self.machine.add_transition('slice', 'uncut', 'cut')

        self.machine.add_transition('repair', 'cut', 'uncut',
                                    after='indels')

    def indels(self):
        self.sequence = ## self.sequence modified
        self.calculate_probability()

    def calculate_probability(self):
        self.cut_probability = ## some function of the sequence
                               ## maybe we can also store the original
                               ## sequence (gRNA) for reference<commit_msg>added original gRNA and test for functionality<commit_after>from transitions import Machine
import random

class TargetSite(object):

    states = ['cut', 'uncut']

    def __init__(self, sequence):

        self.gRNA = sequence
        self.sequence = sequence
        self.functional = True

        self.calculate_probability()

        # Initialize the state machine
        self.machine = Machine(model=self, states=TargetSite.states, initial='uncut')

        # add some transitions. We could also define these using a static list of 
        # dictionaries and then pass the list to 
        # the Machine initializer as the transitions= argument.

        self.machine.add_transition('slice', 'uncut', 'cut')

        self.machine.add_transition('repair', 'cut', 'uncut',
                                    after='indels')

    def indels(self):
        self.sequence = "abc"## self.sequence modified
        self.calculate_probability()
        self.working()

    def calculate_probability(self):
        self.cut_probability = 0.5## some function of the sequence
                               ## maybe we can also store the original
                               ## sequence (gRNA) for reference

    def working(self):
        # only checking for frameshifts
        if (len(self.sequence)-len(self.gRNA))%3 == 0:
            self.functional = True
        else:
            self.functional = False
{'fraction_non_alphanumeric': 0.08807045636509207, 'fraction_numerical': 0.0016012810248198558, 'mean_word_length': 2.1875, '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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7528241', 'n_tokens_mistral': 642, 'n_tokens_neox': 602, 'n_words': 194}