<commit_before>#!/usr/bin/python
# -*- coding: <UTF-8> -*-
"""rspet_client.py: RSPET's Client-side script."""
__author__ = "<NAME>"
__copyright__ = "Copyright 2016, <NAME>"
__credits__ = ["<NAME>", "<NAME>"]
__license__ = "MIT"
__version__ = "0.1.0"
__maintainer__ = "<NAME>"
from __future__ import print_function
from sys import exit as sysexit, argv
from time import sleep
from subprocess import Popen, PIPE
from multiprocessing import Process, freeze_support
from socket import socket, IPPROTO_UDP, IPPROTO_RAW, SOCK_DGRAM, SOCK_STREAM, SOCK_RAW, AF_INET
from socket import error as sock_error
from pinject import UDP, IP


VERSION = "v0.0.6-full"


def get_len(in_string, max_len):
    """Calculate string length, return as a string with trailing 0s.

    Keyword argument(s):
    in_string -- input string
    max_len   -- length of returned string
    """
    tmp_str = str(len(in_string))
    len_to_return = tmp_str
    for _ in range(max_len - len(tmp_str)):
        len_to_return = '0' + len_to_return
    return len_to_return


def make_en_stdout(stdout, sock):
    """Obfuscate (xor) and send string, return integer.

    Keyword argument(s):
    stdout -- string to be sent
    sock   -- socket object
    """
    en_stdout = bytearray(stdout, 'UTF-8')<commit_msg>Some of dzervas' changes from #10<commit_after>#!/usr/bin/env python2
# -*- coding: <UTF-8> -*-
"""rspet_client.py: RSPET's Client-side script."""
from __future__ import print_function
from sys import exit as sysexit, argv
from time import sleep
from subprocess import Popen, PIPE
from multiprocessing import Process, freeze_support
from socket import socket, IPPROTO_UDP, IPPROTO_RAW, SOCK_DGRAM, SOCK_STREAM, SOCK_RAW, AF_INET
from socket import error as sock_error
from pinject import UDP, IP
__author__ = "<NAME>"
__copyright__ = "Copyright 2016, Kolokotronis Panagiotis"
__credits__ = ["<NAME>", "<NAME>"]
__license__ = "MIT"
__version__ = "0.1.0"
__maintainer__ = "<NAME>"


VERSION = "v0.1.0-full"


def get_len(in_string, max_len):
    """Calculate string length, return as a string with trailing 0s.

    Keyword argument(s):
    in_string -- input string
    max_len   -- length of returned string
    """
    tmp_str = str(len(in_string))
    len_to_return = tmp_str
    for _ in range(max_len - len(tmp_str)):
        len_to_return = '0' + len_to_return
    return len_to_return


def make_en_stdout(stdout, sock):
    """Obfuscate (xor) and send string, return integer.

    Keyword argument(s):
    stdout -- string to be sent
    sock   -- socket object
    """
    en_stdout = bytearray(stdout, 'UTF-8')
{'fraction_non_alphanumeric': 0.11171032357473036, 'fraction_numerical': 0.011941448382126348, 'mean_word_length': 3.9372623574144487, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, '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': '3180842', 'n_tokens_mistral': 904, 'n_tokens_neox': 864, 'n_words': 264}