<commit_before><?php
/*
 * This file is part of the Invite Wsapi Bundle
 *
 * (c) Invite Networks Inc. <<EMAIL>>
 *
 * For the full copyright and license information, 
 * please view the LICENSE file that was distributed 
 * with this source code.
 */
namespace Invite\Bundle\Cisco\WsapiBundle\Command;

use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Output\OutputInterface;
use Invite\Component\Ssh\Client\Cisco\IosSshClient;

/**
 * XcdrRegisterCommand.
 *
 * @author <NAME> <<EMAIL>>
 */
class XcdrCheckCommand extends ContainerAwareCommand
{

    protected function configure()
    {
        $this
                ->setName('invite:wsapi:xcdr:check')
                ->setDescription('Check if there is an active registration with UC Gateway')
                ->addArgument(
                        'host', InputArgument::REQUIRED, 'Hostname or IP address of device'
                )
                ->addArgument(
                        'username', InputArgument::REQUIRED, 'Username to login to the device'
                )
                ->addArgument(
                        'password', InputArgument::REQUIRED, 'Password to login to the device'
                )
        ;
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $host = $input->getArgument('host');
        $username = $input->getArgument('username');
        $password = $input->getArgument('password');

        $client = new IosSshClient($host, $username, $password);

        $client->connect();
        $data = $client->wsapiXcdrReg();
        $client->close();

        $output->writeln('<info></info>');
        $output->writeln('<info>' . $host . ' XCDR Registration Status</info>');
        $output->writeln('<info>======================================</info>');
        foreach ($data as $k => $v) {
            $output->writeln(' <info>' . $k . ' </info>:<comment> ' . $v . '</comment>');
        }
        $output->writeln('<info></info>');
    }

}<commit_msg>Fixed command on blank data<commit_after><?php
/*
 * This file is part of the Invite Wsapi Bundle
 *
 * (c) Invite Networks Inc. <<EMAIL>>
 *
 * For the full copyright and license information, 
 * please view the LICENSE file that was distributed 
 * with this source code.
 */
namespace Invite\Bundle\Cisco\WsapiBundle\Command;

use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Output\OutputInterface;
use Invite\Component\Ssh\Client\Cisco\IosSshClient;

/**
 * XcdrRegisterCommand.
 *
 * @author <NAME> <<EMAIL>>
 */
class XcdrCheckCommand extends ContainerAwareCommand
{

    protected function configure()
    {
        $this
                ->setName('invite:wsapi:xcdr:check')
                ->setDescription('Check if there is an active registration with UC Gateway')
                ->addArgument(
                        'host', InputArgument::REQUIRED, 'Hostname or IP address of device'
                )
                ->addArgument(
                        'username', InputArgument::REQUIRED, 'Username to login to the device'
                )
                ->addArgument(
                        'password', InputArgument::REQUIRED, 'Password to login to the device'
                )
        ;
    }

    protected function execute(InputInterface $input, OutputInterface $output)
    {
        $host = $input->getArgument('host');
        $username = $input->getArgument('username');
        $password = $input->getArgument('password');

        $client = new IosSshClient($host, $username, $password);

        $client->connect();
        $data = $client->wsapiXcdrReg();
        $client->close();

        $output->writeln('<info></info>');
        $output->writeln('<info>' . $host . ' XCDR Registration Status</info>');
        $output->writeln('<info>======================================</info>');
        if ($data) {
            foreach ($data as $k => $v) {
                $output->writeln(' <info>' . $k . ' </info>:<comment> ' . $v . '</comment>');
            }
        } else {
            $output->writeln(' <comment> ' . $host . ' does not appear to be registered.</comment>');
        }
        $output->writeln('<info></info>');
    }

}
{'fraction_non_alphanumeric': 0.15364001786511836, 'fraction_numerical': 0.0, 'mean_word_length': 2.4295558958652372, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 74, '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': '7560614', 'n_tokens_mistral': 1248, 'n_tokens_neox': 1201, 'n_words': 288}