<commit_before>#!/usr/bin/env php
<?php

(@include_once __DIR__.'/../vendor/autoload.php') OR (print('ERROR: Installation incomplete, please see README' . PHP_EOL) AND exit(1));

$remote = isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : null;

if ($remote === null) {
    echo 'No remote target given' . PHP_EOL;
    exit(1);
}

$loop = React\EventLoop\Factory::create();

$icmp = new Icmp($loop);

echo 'Pinging "' . $remote . '"...' . PHP_EOL;
$start = microtime(true);
$icmp->ping($remote)->then(function () use ($start, $icmp) {
    echo 'Success after ' . round(microtime(true) - $start, 3) . 's' . PHP_EOL;
    $icmp->pause();
}, function ($error) {
    echo 'Error: ' . $error->getMessage() . PHP_EOL;
    exit(1);
});

$loop->run();
<commit_msg>Use Icmp namespace<commit_after>#!/usr/bin/env php
<?php

(@include_once __DIR__.'/../vendor/autoload.php') OR (print('ERROR: Installation incomplete, please see README' . PHP_EOL) AND exit(1));

$remote = isset($_SERVER['argv'][1]) ? $_SERVER['argv'][1] : null;

if ($remote === null) {
    echo 'No remote target given' . PHP_EOL;
    exit(1);
}

$loop = React\EventLoop\Factory::create();

$icmp = new Icmp\Icmp($loop);

echo 'Pinging "' . $remote . '"...' . PHP_EOL;
$start = microtime(true);
$icmp->ping($remote)->then(function () use ($start, $icmp) {
    echo 'Success after ' . round(microtime(true) - $start, 3) . 's' . PHP_EOL;
    $icmp->pause();
}, function ($error) {
    echo 'Error: ' . $error->getMessage() . PHP_EOL;
    exit(1);
});

$loop->run();

{'fraction_non_alphanumeric': 0.22536136662286466, 'fraction_numerical': 0.00788436268068331, 'mean_word_length': 3.9448051948051948, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 13, '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': '1397267', 'n_tokens_mistral': 573, 'n_tokens_neox': 570, 'n_words': 124}