<commit_before><?php

namespace product_info;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

class Products extends Command
{
    protected function configure()
    {
        $this
            ->setName('product')
            ->setDescription('Product Info')
            ->addArgument(
                'run',
                InputArgument::IS_ARRAY,
                'Run Product Manager'
            )
            ->addOption(
                'createtables',
                null,
                InputOption::VALUE_NONE,
                'Create all tables'
            );
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $data = new \product_data\ProductData();

        if ($input->getOption('createtables')) {
            $data->getDataManager()->getPDO()->exec("CREATE TABLE IF NOT EXISTS products (id INTEGER PRIMARY KEY, psku TEXT, pname TEXT, price REAL, quantity INTEGER)");
            $data->getDataManager()->getPDO()->exec("CREATE TABLE IF NOT EXISTS bundles (id INTEGER PRIMARY KEY, bsku TEXT)");
            $data->getDataManager()->getPDO()->exec("CREATE TABLE IF NOT EXISTS bundle_product (id INTEGER PRIMARY KEY, product_id INTEGER, bundle_id INTEGER)");
            $output->writeln("Tables created.");
        }

        $run = $input->getArgument('run');
        if (isset($run[0])) {
            $text = 'Operation: ' . $run[0];

            if ($run[0] == "import" && isset($run[1]) && ($handle = fopen($run[1], 'r'))) {
                $products = [];
                $bundles = [];
                $pi = 0;
                $bi = 0;

                $total_items = 0;
                $total_sellable = 0;
                $total_non_sellable = 0;
                $total_product_count = 0;
                $total_bundle_count = 0;

                while (($line = fgets($handle)) !== false) {
                    $row = explode("|", $line);<commit_msg>Added total invalid bundle items count<commit_after><?php

namespace product_info;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;

class Products extends Command
{
    protected function configure()
    {
        $this
            ->setName('product')
            ->setDescription('Product Info')
            ->addArgument(
                'run',
                InputArgument::IS_ARRAY,
                'Run Product Manager'
            )
            ->addOption(
                'createtables',
                null,
                InputOption::VALUE_NONE,
                'Create all tables'
            );
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $data = new \product_data\ProductData();

        if ($input->getOption('createtables')) {
            $data->getDataManager()->getPDO()->exec("CREATE TABLE IF NOT EXISTS products (id INTEGER PRIMARY KEY, psku TEXT, pname TEXT, price REAL, quantity INTEGER)");
            $data->getDataManager()->getPDO()->exec("CREATE TABLE IF NOT EXISTS bundles (id INTEGER PRIMARY KEY, bsku TEXT)");
            $data->getDataManager()->getPDO()->exec("CREATE TABLE IF NOT EXISTS bundle_product (id INTEGER PRIMARY KEY, product_id INTEGER, bundle_id INTEGER)");
            $output->writeln("Tables created.");
        }

        $run = $input->getArgument('run');

        if (isset($run[0])) {
            $text = 'Operation: ' . $run[0];

            if ($run[0] == "import" && isset($run[1]) && ($handle = fopen($run[1], 'r'))) {
                $products = [];
                $bundles = [];
                $pi = 0;
                $bi = 0;

                $total_items = 0;
                $total_sellable = 0;
                $total_non_sellable = 0;
                $total_product_count = 0;
                $total_bundle_count = 0;

                while (($line = fgets($handle)) !== false) {
                    $row = explode("|", $line);
{'fraction_non_alphanumeric': 0.13146853146853146, 'fraction_numerical': 0.005594405594405594, 'mean_word_length': 1.977793199167245, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, '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': '182146', 'n_tokens_mistral': 1217, 'n_tokens_neox': 1125, 'n_words': 266}