<commit_before>"""

Client side interface via tcp to the coop door

"""

import socket
import multiprocessing

sock = None
sock_lock = multiprocessing.Lock()

def _send(msg):
    if sock:
        with sock_lock:
            sock.sendall(msg)
            return sock.recv(1024)
    return False

def connect():
    global sock
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    sock.connect(('127.0.0.1', 8953))


def status():
    return _send('status\n')
def open():
    return _send('open\n')
def close():
    return _send('close\n')
def stop():
    return _send('stop\n')
def reload():
    return _send('reload\n')
def unload():
    return _send('cleanup\n')<commit_msg>status socket connection<commit_after>"""

Client side interface via tcp to the coop door

"""

import socket
import multiprocessing

PORT = 8953
HOST = '127.0.0.1'

sock = None
sock_lock = multiprocessing.Lock()

def _send(msg):
    if sock:
        with sock_lock:
            sock.sendall(msg)
            return sock.recv(1024)
    return False

def connect():
    global sock
    sock = _connect()

def status_socket():
    s = _connect()
    s.sendall('enroll\n')
    return s

def _connect():
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.connect((HOST, PORT))
    return s



def status():
    return _send('status\n')
def open():
    return _send('open\n')
def close():
    return _send('close\n')
def stop():
    return _send('stop\n')
def reload():
    return _send('reload\n')
def unload():
    return _send('cleanup\n')
{'fraction_non_alphanumeric': 0.13532856213402733, 'fraction_numerical': 0.018217306441119064, 'mean_word_length': 3.0473684210526315, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '1918261', 'n_tokens_mistral': 537, 'n_tokens_neox': 513, 'n_words': 142}