<commit_before><?php

namespace Youtubedl;

use Composer\Script\Event;
use React\EventLoop\Factory;
use React\Stream\Stream;
use Symfony\Component\Process\Process;

class Installation
{
    public static function postUpdate(Event $event)
    {
        if (file_exists(Config::getBinFile())) {
            $process = new Process(Config::getBinFile().' -U');
            $process->run();
        } else {
            self::postInstall($event);
        }
    }

    public static function postInstall(Event $event)
    {
        Config::makeBinDirectory();
        $loop = Factory::create();
        $file = Config::getBinFile();
        $url = 'https://yt-dl.org/downloads/latest/youtube-dl';
        $readStream = fopen($url, 'r');
        $writeStream = fopen($file, 'w');
        stream_set_blocking($readStream, 0);
        stream_set_blocking($writeStream, 0);
        $read = new Stream($readStream, $loop);
        $write = new Stream($writeStream, $loop);
        $read->on('end', function () use ($file) {
            chmod($file, 0777);
            echo "Finished downloading $file\n";
        });
        $read->pipe($write);
        $loop->run();
    }
}
<commit_msg>remove event var<commit_after><?php

namespace Youtubedl;

use React\EventLoop\Factory;
use React\Stream\Stream;
use Symfony\Component\Process\Process;

class Installation
{
    public static function postUpdate()
    {
        if (file_exists(Config::getBinFile())) {
            $process = new Process(Config::getBinFile().' -U');
            $process->run();
        } else {
            self::postInstall();
        }
    }

    public static function postInstall()
    {
        Config::makeBinDirectory();
        $loop = Factory::create();
        $file = Config::getBinFile();
        $url = 'https://yt-dl.org/downloads/latest/youtube-dl';
        $readStream = fopen($url, 'r');
        $writeStream = fopen($file, 'w');
        stream_set_blocking($readStream, 0);
        stream_set_blocking($writeStream, 0);
        $read = new Stream($readStream, $loop);
        $write = new Stream($writeStream, $loop);
        $read->on('end', function () use ($file) {
            chmod($file, 0777);
            echo "Finished downloading $file\n";
        });
        $read->pipe($write);
        $loop->run();
    }
}

{'fraction_non_alphanumeric': 0.15739130434782608, 'fraction_numerical': 0.0052173913043478265, 'mean_word_length': 2.4190193164933134, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2338318', 'n_tokens_mistral': 700, 'n_tokens_neox': 683, 'n_words': 136}