<commit_before>#!/usr/bin/python3
"""Provide interface for sending commands to live Cinch server."""
from multiprocessing.connection import Client, Listener
from time import sleep

self_address = ('localhost', 8676)
server_address = ('localhost', 8675)


def menu():
    print()
    val = input('$ > ')
    print()
    
    return val

if __name__ == "__main__":
    sleep(0.5) # Allow extra time for Cinch server to prepare
    
    # First, contact waiting server
    conn_out = Client(server_address)

    # Then, listen for first response
    listener = Listener(self_address)
    conn_in = listener.accept()
    print("="*40)
    print("Connection established with Cinch server")
    print()
    print("Typing 'help' is a good start; 'exit' quits the command console.")    

    # Begin menu interface with user
    while True:
        val = menu()
        
        if "exit" == val:
            break
        else:
            conn_out.send(val)
            print(conn_in.recv())
    
    conn_out.close()
    conn_in.close()
    listener.close()
<commit_msg>Minor console tweak<commit_after>#!/usr/bin/python3
"""Provide interface for sending commands to live Cinch server."""
from multiprocessing.connection import Client, Listener
from time import sleep

self_address = ('localhost', 8676)
server_address = ('localhost', 8675)


def menu():
    print()
    val = input('$ > ')
    print()
    
    return val

if __name__ == "__main__":
    sleep(0.5) # Allow extra time for Cinch server to prepare
    
    # First, contact waiting server
    conn_out = Client(server_address)

    # Then, listen for first response
    listener = Listener(self_address)
    conn_in = listener.accept()
    print("="*40)
    print("Connection established with Cinch server")
    print()
    print("Typing 'help' is a good start; 'exit' quits the command console.")    

    # Begin menu interface with user
    while True:
        val = menu()
        
        if "exit" == val:
            break
        else:
            conn_out.send(val)
            print(conn_in.recv())
            
            if "halt" == val:
                break # User took server down, so exit here too.
    
    conn_out.close()
    conn_in.close()
    listener.close()

{'fraction_non_alphanumeric': 0.10695187165775401, 'fraction_numerical': 0.011586452762923352, 'mean_word_length': 2.4591679506933746, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, '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': '5959233', 'n_tokens_mistral': 671, 'n_tokens_neox': 648, 'n_words': 208}