<commit_before># abstraction layer for external interpreter
# parts for non-blocking communication are taken from
# https://gist.github.com/EyalAr/7915597

import json
import subprocess
import sys
import splitstream

debug_mode = False


class FrotzbotBackend():
    def __init__(self,
                 arg_frotz_path,
                 arg_game_path,
                 savefile_prefix='',
                 terp_args=['-fm', '-width', '60', '-height', '100']):
        if not terp_args:
            print('WARNING: NO TERP ARGS SPECIFIED! REMGLK WILL NOT PRODUCE ANY OUTPUT UNTIL FORMAT ARGUMENTS ARE SPECIFIED MANUALLY!')

        self.terp_path = arg_frotz_path
        self.game_path = arg_game_path
        self.savefile_prefix = savefile_prefix
        try:<commit_msg>remove old notice about process communication.<commit_after>import json
import subprocess
import sys
import splitstream

debug_mode = False


class FrotzbotBackend():
    def __init__(self,
                 arg_frotz_path,
                 arg_game_path,
                 savefile_prefix='',
                 terp_args=['-fm', '-width', '60', '-height', '100']):
        if not terp_args:
            print('WARNING: NO TERP ARGS SPECIFIED! REMGLK WILL NOT PRODUCE ANY OUTPUT UNTIL FORMAT ARGUMENTS ARE SPECIFIED MANUALLY!')

        self.terp_path = arg_frotz_path
        self.game_path = arg_game_path
        self.savefile_prefix = savefile_prefix
        try:
{'fraction_non_alphanumeric': 0.0807799442896936, 'fraction_numerical': 0.011838440111420613, 'mean_word_length': 2.56575682382134, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, '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': '1948399', 'n_tokens_mistral': 463, 'n_tokens_neox': 437, 'n_words': 116}