def deobfuscate_string(self, s):
        # Split it up by spaces into words
        parts = s.split(' ')

        # Start our loop out with last being the first word in the string
        last = "--terminate--"
        # Get our last_list based on the words that can follow last
        last_list = sorted(self.raw_scores[last].items(), key=operator.itemgetter(1))[::-1]
        result = []

        running_values = None
        running_list_lengths = None
        running_value = None

        # Loop until we have no words left
        while len(parts) != 0:
            # Once you pop, you just can't stop
            current_word = parts.pop(0)

            # Convert .'s to --terminate--, as . is our terminator (I'll be back...)
            if current_word == ".":
                current_word = "--terminate--"

            # If it is an empty string, then we should just move on and pretend nothing happened here
            if current_word == "":
                continue

            # Grab the list of words that can follow our current word
            current_list = sorted(self.raw_scores[current_word].items(), key=operator.itemgetter(1))[::-1]
            current_value = None

            # We need the value of the current word
            for x in xrange(len(last_list)):
                if last_list[x][0] == current_word:
                    current_value = x
                    break

            # The multiple word transitions make everything way more complicated
            if running_values is not None:
                # Keep pushing lengths of potential values until we get over 256
                running_list_lengths.append(len(last_list))
                running_values.append(current_value)
                if sum(running_list_lengths) >= 256:
                    # We made it!  Now add the running value and start again
                    result.append(sum(running_values))
                    # running_value = sum(running_values)
                    running_list_lengths = None
                    running_values = None
            elif running_value is not None:
                # I think this is deprecated, but I wrote this a while ago
                result.append(current_value + running_value)
                running_value = None
            elif len(last_list) < 256:
                # Keep adding to the running values, we aren't home yet
                running_values = [current_value]
                running_list_lengths = [len(last_list)]
            else:
                # Good old simple single word transition byte, reminds me of a simpler time
                # Back before I decided to support Markov models which did not have sufficient relations between words
                result.append(current_value)

            last = current_word
            last_list = current_list

        # Shake out the remaining drop
        if running_value is not None:
            result.append(running_value)

        # Shake out the remaining drops
        if running_values is not None:
            result.append(sum(running_values))

        # Trim off first number
        result = result[1:]

        # Change the number base
        result = MarkovKeyState.base_to_chars(result, self.new_base)

        # Join the ints together as chrs, to live in harmony forevaaaa
        return "".join(map(chr, result))
Well...now we need to be able to deobfuscate a string, right?
dataset/ETHPy150Open bwall/markovobfuscate/markovobfuscate/obfuscation.py/MarkovKeyState.deobfuscate_string