<commit_before><?php

/*
 * This file is part of the Yodler package.
 *
 * (c) aes3xs <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Aes3xs\Yodler\Commander;

use Aes3xs\Yodler\Common\ProcessFactory;
use Symfony\Component\Filesystem\Filesystem;

class LocalCommander implements CommanderInterface
{
    const TIMEOUT = 300;

    protected $filesystem;
    protected $processFactory;

    public function __construct(Filesystem $filesystem, ProcessFactory $processFactory)
    {
        $this->filesystem = $filesystem;
        $this->processFactory = $processFactory;
    }

    /**
     * {@inheritdoc}
     */
    public function exec($command)
    {
        $process = $this->processFactory->create($command);
        $process->setTimeout(self::TIMEOUT);
        $process->setIdleTimeout(self::TIMEOUT);
        $process->mustRun();

        return $process->getOutput();
    }

    /**
     * {@inheritdoc}
     */
    public function send($local, $remote)
    {
        $this->filesystem->copy($local, $remote);
    }

    /**
     * {@inheritdoc}
     */
    public function recv($remote, $local)
    {
        $this->filesystem->copy($remote, $local);
    }
}<commit_msg>Fix download and upload on local commander<commit_after><?php

/*
 * This file is part of the Yodler package.
 *
 * (c) aes3xs <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Aes3xs\Yodler\Commander;

use Aes3xs\Yodler\Common\ProcessFactory;
use Symfony\Component\Filesystem\Filesystem;

class LocalCommander implements CommanderInterface
{
    const TIMEOUT = 300;

    protected $filesystem;
    protected $processFactory;

    public function __construct(Filesystem $filesystem, ProcessFactory $processFactory)
    {
        $this->filesystem = $filesystem;
        $this->processFactory = $processFactory;
    }

    /**
     * {@inheritdoc}
     */
    public function exec($command)
    {
        $process = $this->processFactory->create($command);
        $process->setTimeout(self::TIMEOUT);
        $process->setIdleTimeout(self::TIMEOUT);
        $process->mustRun();

        return $process->getOutput();
    }

    /**
     * {@inheritdoc}
     */
    public function send($local, $remote)
    {
        $this->filesystem->copy($local, $remote, true);
    }

    /**
     * {@inheritdoc}
     */
    public function recv($remote, $local)
    {
        $this->filesystem->copy($remote, $local, true);
    }
}
{'fraction_non_alphanumeric': 0.13011863758132414, 'fraction_numerical': 0.004592422502870264, 'mean_word_length': 2.861152141802068, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7535910', 'n_tokens_mistral': 777, 'n_tokens_neox': 763, 'n_words': 174}