<commit_before><?php

include_once __DIR__.'/../vendor/autoload.php';

function parse($socket)
{
    // workaround parsing plain port numbers
    if (preg_match('/^\d+$/', $socket)) {
        return array('port' => (int)$socket);
    }

    // workaround for incorrect parsing when scheme is missing
    $parts = parse_url((strpos($socket, '://') === false ? 'socks://' : '') . $socket);
    if (!$parts) {
        throw new InvalidArgumentException('Invalid/unparsable socket given');
    }
    if (isset($parts['path']) || isset($parts['query']) || isset($parts['frament'])) {
        throw new InvalidArgumentException('Invalid socket given');
    }
    return $parts;
}

// $socket = null;
// $socket = 'socks://me@localhost:9050';
// $socket = 'localhost:9050';
$socket = isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : null;
<commit_msg>Fix autoload path<commit_after><?php

include_once __DIR__.'/vendor/autoload.php';

function parse($socket)
{
    // workaround parsing plain port numbers
    if (preg_match('/^\d+$/', $socket)) {
        return array('port' => (int)$socket);
    }

    // workaround for incorrect parsing when scheme is missing
    $parts = parse_url((strpos($socket, '://') === false ? 'socks://' : '') . $socket);
    if (!$parts) {
        throw new InvalidArgumentException('Invalid/unparsable socket given');
    }
    if (isset($parts['path']) || isset($parts['query']) || isset($parts['frament'])) {
        throw new InvalidArgumentException('Invalid socket given');
    }
    return $parts;
}

// $socket = null;
// $socket = 'socks://me@localhost:9050';
// $socket = 'localhost:9050';
$socket = isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : null;

{'fraction_non_alphanumeric': 0.20378027170702895, 'fraction_numerical': 0.011813349084465446, 'mean_word_length': 3.6538461538461537, 'pattern_counts': {'":': 0, '<': 5, '<?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': '1486147', 'n_tokens_mistral': 534, 'n_tokens_neox': 523, 'n_words': 116}