<commit_before><?php

/**
 * A symfony command to run Amazon SDK Commands
 *
 * @author <NAME>
 * @date 2013-03-20
 */

namespace Uecode\Bundle\AmazonBundle\Command;

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;

// Amazon Classes
use \AmazonSWF;
use \CFRuntime;

class AWSSDKCommand extends Command
{
    protected $name = "poll:ue:workflow:uePoc";
    protected function configure() {
        $this
            ->setName('ue:workflow:start')
            ->setDescription('Send a start workflow execution to amazon.')
            ->addArgument(
                'aws_key',
                InputArgument::REQUIRED,
                'The amazon AWS key used for authentication'
            )
            ->addArgument(
                'aws_secret',
                InputArgument::REQUIRED,
                'The amazon AWS secret used for authentication'
            )
            ->addArgument(
                'sdk_command',
                InputArgument::REQUIRED,
                'The amazon SDK command (v1 of SDK)'
            )
            ->addArgument(
                'options',
                InputArgument::REQUIRED,
                'The amazon SWF options (as JSON object)'
            );
    }

    protected function execute(InputInterface $input, OutputInterface $output) {
        $key = $input->getArgument('aws_key');
        $secret = $input->getArgument('aws_secret');
        $command = $input->getArgument('sdk_command');
        $options = $input->getArgument('options');

        $swf = new AmazonSWF(array('key' => $key, 'secret' => $secret));

        if (!method_exists($swf, $command)) {
            throw new Exception('Amazon SWF/SDK method \'$command\' does not exist');
        }

        $result = $swf->{$command}(json_decode($options, true));
        $output->writeln($result->body);
    }
}<commit_msg>fixed command args for amazon sdk command<commit_after><?php

/**
 * A symfony command to run Amazon SDK Commands
 *
 * Note that this currently only supports v1 of the PHP SDK.
 *
 * @author <NAME>
 * @date 2013-03-20
 */

namespace Uecode\Bundle\AmazonBundle\Command;

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;

// Amazon Classes
use \AmazonSWF;
use \CFRuntime;

class AWSSDKCommand extends Command
{
    protected $name = "poll:ue:workflow:uePoc";
    protected function configure() {
        $this
            ->setName('ue:workflow:start')
            ->setDescription('Send a start workflow execution to amazon.')
            ->addOption(
                'key',
                null,
                InputOption::VALUE_REQUIRED,
                'The amazon AWS key used for authentication'
            )
            ->addOption(
                'secret',
                null,
                InputOption::VALUE_REQUIRED,
                'The amazon AWS secret used for authentication'
            )
            ->addOption(
                'sdk_command',
                null,
                InputOption::VALUE_REQUIRED,
                'The amazon SDK command (v1 of SDK)'
            )
            ->addOption(
                'options',
                null,
                InputOption::VALUE_REQUIRED,
                'The amazon SWF options (as JSON object)'
            );
    }

    protected function execute(InputInterface $input, OutputInterface $output) {
        $key = $input->getOption('key');
        $secret = $input->getOption('secret');
        $command = $input->getOption('sdk_command');
        $options = $input->getOption('options');

        $swf = new AmazonSWF(array('key' => $key, 'secret' => $secret));

        if (!method_exists($swf, $command)) {
            throw new \Exception('Amazon SWF/SDK method "'.$command.'" does not exist');
        }

        $options = json_decode($options, true);
        $result = $swf->{$command}($options);
        $output->writeln($result->body);
    }
}
{'fraction_non_alphanumeric': 0.11904761904761904, 'fraction_numerical': 0.004435107376283847, 'mean_word_length': 2.102824040550326, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5995373', 'n_tokens_mistral': 1202, 'n_tokens_neox': 1143, 'n_words': 275}