<commit_before><?php

namespace Sirius\Upload\Container;

class Local implements ContainerInterface
{

    protected $baseDirectory;

    public function __construct($baseDirectory)
    {
        $this->baseDirectory = $this->normalizePath($baseDirectory) . DIRECTORY_SEPARATOR;
        $this->ensureDirectory($this->baseDirectory);
    }

    protected function normalizePath($path)
    {
        $path = dirname(rtrim($path, '\\/') . DIRECTORY_SEPARATOR . 'xxx');

        return rtrim($path, DIRECTORY_SEPARATOR);
    }

    protected function ensureDirectory($directory)
    {
        if (!is_dir($directory)) {
            /**
             * change prefix directory from 766 to 755:
             * 755 is the way to go because the User need the execute flag to enter the directory.
             * Same issue with 766 if the Web user is either Group or Others. 6 = read/write and lack the execute flag.
             * So 766 wont work if the web server is not the owner of the directory.
            */
            mkdir($directory, 0755, true);
        }

        return is_dir($directory) && $this->isWritable();
    }

    /**
     * Check if the container is writable
     */
    public function isWritable()
    {
        return is_writable($this->baseDirectory);
    }

    /**
     * This will check if a file is in the container
     *
     * @param  string $file
     * @return bool
     */
    public function has($file)
    {<commit_msg>Remove redundant comment in Container\Local::ensureDirectory()<commit_after><?php

namespace Sirius\Upload\Container;

class Local implements ContainerInterface
{

    protected $baseDirectory;

    public function __construct($baseDirectory)
    {
        $this->baseDirectory = $this->normalizePath($baseDirectory) . DIRECTORY_SEPARATOR;
        $this->ensureDirectory($this->baseDirectory);
    }

    protected function normalizePath($path)
    {
        $path = dirname(rtrim($path, '\\/') . DIRECTORY_SEPARATOR . 'xxx');

        return rtrim($path, DIRECTORY_SEPARATOR);
    }

    protected function ensureDirectory($directory)
    {
        if (!is_dir($directory)) {
            mkdir($directory, 0755, true);
        }

        return is_dir($directory) && $this->isWritable();
    }

    /**
     * Check if the container is writable
     */
    public function isWritable()
    {
        return is_writable($this->baseDirectory);
    }

    /**
     * This will check if a file is in the container
     *
     * @param  string $file
     * @return bool
     */
    public function has($file)
    {
{'fraction_non_alphanumeric': 0.10733801717408274, 'fraction_numerical': 0.00936768149882904, 'mean_word_length': 2.3857331571994718, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, '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': '7451766', 'n_tokens_mistral': 739, 'n_tokens_neox': 694, 'n_words': 195}