<commit_before><?php

namespace Bluora\LaravelDatasets\Commands;

use Bluora\LaravelDatasets\Traits\CommandTrait;
use DB;
use GuzzleHttp\Client as GuzzleClient;
use Illuminate\Console\Command;
use League\Flysystem\Filesystem;
use League\Flysystem\Adapter\Local as Adapter;

class MigrateCommand extends Command
{
    use CommandTrait;

    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'datasets:migrate {dataset}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Syncronizes data using configuration and closures';

    /**
     * The loaded configuration file.
     *
     * @var array
     */
    protected $config;

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        $this->splash(sprintf("Migrating database for '%s'", $this->argument('dataset')));

        $this->runMigration();

        $this->info('Completed migration.');
        $this->line('');
    }

    /**
     * Load and run migration.
     *
     * @return void
     *
     * @SupressWarnings(PHPMD.ExitExpression)
     */
    private function runMigration()
    {
        $result = DB::select(DB::raw('SHOW TABLES LIKE \'data_'.$this->argument('dataset').'\''));

        if (count($result)) {
            $this->error(sprintf('\'%s\' table already exists.', 'data_'.$this->argument('dataset')));
            $this->line('');

            exit(1);
        }

        $migration_namespace = 'Bluora\\LaravelDatasets\\Migrations';
        $migration_class_name = sprintf('CreateData%sTable', studly_case($this->argument('dataset')));
        $migration_class = sprintf('%s\\%s', $migration_namespace, $migration_class_name);

        // Supplied dataset config file does not exist.
        if (!class_exists($migration_class)) {
            $this->error(sprintf('\'%s\' does not exist.', $this->argument('dataset')));<commit_msg>Ignore long variable<commit_after><?php

namespace Bluora\LaravelDatasets\Commands;

use Bluora\LaravelDatasets\Traits\CommandTrait;
use DB;
use GuzzleHttp\Client as GuzzleClient;
use Illuminate\Console\Command;
use League\Flysystem\Filesystem;
use League\Flysystem\Adapter\Local as Adapter;

class MigrateCommand extends Command
{
    use CommandTrait;

    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'datasets:migrate {dataset}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Syncronizes data using configuration and closures';

    /**
     * The loaded configuration file.
     *
     * @var array
     */
    protected $config;

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        $this->splash(sprintf("Migrating database for '%s'", $this->argument('dataset')));

        $this->runMigration();

        $this->info('Completed migration.');
        $this->line('');
    }

    /**
     * Load and run migration.
     *
     * @return void
     *
     * @SupressWarnings(PHPMD.ExitExpression)
     * @SupressWarnings(PHPMD.LongVariable)
     */
    private function runMigration()
    {
        $result = DB::select(DB::raw('SHOW TABLES LIKE \'data_'.$this->argument('dataset').'\''));

        if (count($result)) {
            $this->error(sprintf('\'%s\' table already exists.', 'data_'.$this->argument('dataset')));
            $this->line('');

            exit(1);
        }

        $migration_namespace = 'Bluora\\LaravelDatasets\\Migrations';
        $migration_class_name = sprintf('CreateData%sTable', studly_case($this->argument('dataset')));
        $migration_class = sprintf('%s\\%s', $migration_namespace, $migration_class_name);

        // Supplied dataset config file does not exist.
        if (!class_exists($migration_class)) {
            $this->error(sprintf('\'%s\' does not exist.', $this->argument('dataset')));
{'fraction_non_alphanumeric': 0.14792025596849617, 'fraction_numerical': 0.0004922471080482402, 'mean_word_length': 2.6448430493273545, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 27, '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': '4099588', 'n_tokens_mistral': 1209, 'n_tokens_neox': 1201, 'n_words': 254}