<commit_before><?php

include_once dirname(__DIR__) . '/vendor/autoload.php';

use Deimos\Imaginarium\Builder;

$builder = new Builder(dirname(__DIR__));
$request = $builder->request();

header("HTTP/1.1 404 Not Found");

if ($_SERVER['USER'] === 'www-data')
{

    $route = [
        'type' => 'pattern',
        'path' => 'storage/<user>/<type>(/<config>)/<ha>/<sh>/<hash>'
    ];

    $router = new \Deimos\Router\Router();

    $router->setRoutes([$route]);
    $router->setMethod();

    $route = $router->getCurrentRoute($request->query('q'));

    $attributes = $route->attributes();
    $sdk = new Deimos\ImaginariumSDK\SDK();
    
    $sdk->setBasedir(dirname(__DIR__) . '/storage');
    $sdk->setUserName($attributes['user']);

    if (file_exists($sdk->getOriginalPath( $attributes['hash'] )))
    {
        $configObject = $builder->config()->get('gearman');

        $gearman = new \GearmanClient();
        $gearman->addServer(
            $configObject->get('host', '127.0.0.1'),
            $configObject->get('port', 4730)
        );

        $gearman->doBackground('resize', json_encode([
            'hash'  => $attributes['hash'],
            'user'  => $attributes['user'],<commit_msg>Update regenerate.php<commit_after><?php

include_once dirname(__DIR__) . '/vendor/autoload.php';

use Deimos\Imaginarium\Builder;

$builder = new Builder(dirname(__DIR__));
$request = $builder->request();

header("HTTP/1.1 404 Not Found");

if ($_SERVER['USER'] === 'www-data')
{

    $route = [
        'type' => 'pattern',
        'path' => [
            'storage/<user>/<type>(/<config>)/<ha>/<sh>/<hash>',
            [
                'config' => '[\w-А-ЯЁа-яё~]+'
            ]
        ]
    ];

    $router = new \Deimos\Router\Router();

    $router->setRoutes([$route]);
    $router->setMethod();

    $route = $router->getCurrentRoute($request->query('q'));

    $attributes = $route->attributes();
    $sdk = new Deimos\ImaginariumSDK\SDK();
    
    $sdk->setBasedir(dirname(__DIR__) . '/storage');
    $sdk->setUserName($attributes['user']);

    if (file_exists($sdk->getOriginalPath( $attributes['hash'] )))
    {
        $configObject = $builder->config()->get('gearman');

        $gearman = new \GearmanClient();
        $gearman->addServer(
            $configObject->get('host', '127.0.0.1'),
            $configObject->get('port', 4730)
        );

        $gearman->doBackground('resize', json_encode([
            'hash'  => $attributes['hash'],
            'user'  => $attributes['user'],
{'fraction_non_alphanumeric': 0.21357681619690352, 'fraction_numerical': 0.011909487892020643, 'mean_word_length': 2.841463414634146, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 54, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 2, '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': '1260206', 'n_tokens_mistral': 857, 'n_tokens_neox': 819, 'n_words': 116}