<commit_before>#!/bin/python
import os
import requests
import json
from subprocess import Popen, PIPE


def initializeGekko():  # not used yet.
    CMD = ['node', gekkoDIR + '/gekko', '--ui']
    D = Popen(CMD, stdin=PIPE, stdout=PIPE, stderr=PIPE)


def httpPost(URL, data={}):
    try:
        Request = requests.post(URL, json=data)
        Response = json.loads(Request.text)
    except ConnectionRefusedError:
        print("Error: Gekko comm error! Check your local Gekko instance.")
        exit()
    except Exception as e:
        print("Error: config failure")
        print(URL)
        print(data)
        raise e

    return Response


def loadHostsFile(HostsFilePath):
    remoteGekkos = []
    if os.path.isfile(HostsFilePath):
        H = open(HostsFilePath).read().split('\n')
        for W in H:
            if W and not '=' in W and not '[' in W:
                remoteGekkos.append("http://%s:3000" % W)
    return remoteGekkos<commit_msg>ease consequences of config failure<commit_after>#!/bin/python
import os
import requests
import json
from subprocess import Popen, PIPE


def initializeGekko():  # not used yet.
    CMD = ['node', gekkoDIR + '/gekko', '--ui']
    D = Popen(CMD, stdin=PIPE, stdout=PIPE, stderr=PIPE)


def httpPost(URL, data={}):
    try:
        Request = requests.post(URL, json=data)
        Response = json.loads(Request.text)
    except ConnectionRefusedError:
        print("Error: Gekko comm error! Check your local Gekko instance.")
        exit()
    except Exception as e:
        print("Error: config failure")
        print(URL)
        print(data)
        return {'report': False}

    return Response


def loadHostsFile(HostsFilePath):
    remoteGekkos = []
    if os.path.isfile(HostsFilePath):
        H = open(HostsFilePath).read().split('\n')
        for W in H:
            if W and not '=' in W and not '[' in W:
                remoteGekkos.append("http://%s:3000" % W)
    return remoteGekkos
{'fraction_non_alphanumeric': 0.12314767501277465, 'fraction_numerical': 0.004087889626980072, 'mean_word_length': 2.6259259259259258, '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': '5359813', 'n_tokens_mistral': 642, 'n_tokens_neox': 627, 'n_words': 176}