<commit_before><?php
class SendGridTest_SendGrid extends \PHPUnit_Framework_TestCase
{
    protected static $apiKey;
    protected static $sg;
    protected static $pid;

    public static function setUpBeforeClass()
    {
        self::$apiKey = "SENDGRID_API_KEY";
        $host = array('host' => 'http://localhost:4010');
        self::$sg = new SendGrid(self::$apiKey, $host);
        if (file_exists('/usr/local/bin/prism') == false) {
            if (strtoupper(substr(php_uname('s'), 0, 3)) != 'WIN') {
                try {
                    $proc_ls = proc_open("curl https://raw.githubusercontent.com/stoplightio/prism/master/install.sh",
                                        array(
                                            array("pipe","r"), //stdin
                                            array("pipe","w"), //stdout
                                            array("pipe","w")  //stderr
                                        ),
                                        $pipes);
                    $output_ls = stream_get_contents($pipes[1]);
                    fclose($pipes[0]);
                    fclose($pipes[1]);
                    fclose($pipes[2]);
                    $return_value_ls = proc_close($proc_ls);
                    $proc_grep = proc_open("sh",
                                            array(
                                                array("pipe","r"), //stdin
                                                array("pipe","w"), //stdout
                                                array("pipe","w")  //stderr
                                            ),
                                            $pipes);

                    fwrite($pipes[0], $output_ls);
                    fclose($pipes[0]);
                    $output_grep = stream_get_contents($pipes[1]);

                    fclose($pipes[1]);
                    fclose($pipes[2]);
                    proc_close($proc_grep);
                } catch (Exception $e) {
                    print("Error downloading the prism binary, you can try downloading directly here (https://github.com/stoplightio/prism/releases) and place in your /usr/local/bin directory: " .  $e->getMessage() . "\n");
                    exit();
                }
            } else {
                print("Please download the Windows binary (https://github.com/stoplightio/prism/releases) and place it in your /usr/local/bin directory");
                exit();
            }
        }
        print("Activating Prism (~20 seconds)\n");
        $command = 'nohup prism run -s https://raw.githubusercontent.com/sendgrid/sendgrid-oai/master/oai_stoplight.json > /dev/null 2>&1 & echo $!';
        exec($command, $op);
        self::$pid = (int)$op[0];
        sleep(15);
        print("\nPrism Started");
    }

    public function testHelloWorld()
    {
        $from = new SendGrid\Email("Example User", "<EMAIL>");
        $subject = "Sending with SendGrid is Fun";
        $to = new SendGrid\Email("Example User", "<EMAIL>");<commit_msg>Added a couple newlines to make the test progress align cleanly<commit_after><?php
class SendGridTest_SendGrid extends \PHPUnit_Framework_TestCase
{
    protected static $apiKey;
    protected static $sg;
    protected static $pid;

    public static function setUpBeforeClass()
    {
        self::$apiKey = "SENDGRID_API_KEY";
        $host = array('host' => 'http://localhost:4010');
        self::$sg = new SendGrid(self::$apiKey, $host);
        if (file_exists('/usr/local/bin/prism') == false) {
            if (strtoupper(substr(php_uname('s'), 0, 3)) != 'WIN') {
                try {
                    $proc_ls = proc_open("curl https://raw.githubusercontent.com/stoplightio/prism/master/install.sh",
                                        array(
                                            array("pipe","r"), //stdin
                                            array("pipe","w"), //stdout
                                            array("pipe","w")  //stderr
                                        ),
                                        $pipes);
                    $output_ls = stream_get_contents($pipes[1]);
                    fclose($pipes[0]);
                    fclose($pipes[1]);
                    fclose($pipes[2]);
                    $return_value_ls = proc_close($proc_ls);
                    $proc_grep = proc_open("sh",
                                            array(
                                                array("pipe","r"), //stdin
                                                array("pipe","w"), //stdout
                                                array("pipe","w")  //stderr
                                            ),
                                            $pipes);

                    fwrite($pipes[0], $output_ls);
                    fclose($pipes[0]);
                    $output_grep = stream_get_contents($pipes[1]);

                    fclose($pipes[1]);
                    fclose($pipes[2]);
                    proc_close($proc_grep);
                } catch (Exception $e) {
                    print("Error downloading the prism binary, you can try downloading directly here (https://github.com/stoplightio/prism/releases) and place in your /usr/local/bin directory: " .  $e->getMessage() . "\n");
                    exit();
                }
            } else {
                print("Please download the Windows binary (https://github.com/stoplightio/prism/releases) and place it in your /usr/local/bin directory");
                exit();
            }
        }
        print("Activating Prism (~20 seconds)\n");
        $command = 'nohup prism run -s https://raw.githubusercontent.com/sendgrid/sendgrid-oai/master/oai_stoplight.json > /dev/null 2>&1 & echo $!';
        exec($command, $op);
        self::$pid = (int)$op[0];
        sleep(15);
        print("\nPrism Started\n\n");
    }

    public function testHelloWorld()
    {
        $from = new SendGrid\Email("Example User", "<EMAIL>");
        $subject = "Sending with SendGrid is Fun";
        $to = new SendGrid\Email("Example User", "<EMAIL>");
{'fraction_non_alphanumeric': 0.1302507326603712, 'fraction_numerical': 0.007163790296320417, 'mean_word_length': 1.265953522685356, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 15, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 48, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7457017', 'n_tokens_mistral': 1563, 'n_tokens_neox': 1492, 'n_words': 309}