<commit_before>#!/usr/bin/env python3

import socket
import threading
import sys


def usage(argv):
    print("Usage: {} <server_ip> <server_port>".format(argv))
    sys.exit(1)


def send():
    while True:
        s = input("> ")
        if s == ':q':
            break
        elif s != ':u':
            sock.send(s.encode('ascii'))


def recv():
    while True:
        try:
            data = sock.recv(1024)
        except OSError:
            break
        if data != b'':
            print(data.decode('utf-8', 'ignore') + "\n> ", end='')


if len(sys.argv) != 3:
    usage(sys.argv[0])

server_ip = sys.argv[1]
server_port = int(sys.argv[2])<commit_msg>bugfix: invalid characters in client's out message<commit_after>#!/usr/bin/env python3

import socket
import threading
import sys


def usage(argv):
    print("Usage: {} <server_ip> <server_port>".format(argv))
    sys.exit(1)


def send():
    while True:
        s = input("> ")
        if s == ':q':
            break
        elif s != ':u':
            sock.send(s.encode('ascii', 'replace'))


def recv():
    while True:
        try:
            data = sock.recv(1024)
        except OSError:
            break
        if data != b'':
            print(data.decode('utf-8', 'ignore') + "\n> ", end='')


if len(sys.argv) != 3:
    usage(sys.argv[0])

server_ip = sys.argv[1]
server_port = int(sys.argv[2])
{'fraction_non_alphanumeric': 0.16957787481804948, 'fraction_numerical': 0.01601164483260553, 'mean_word_length': 2.1108597285067874, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, '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': '5639434', 'n_tokens_mistral': 492, 'n_tokens_neox': 466, 'n_words': 112}