<commit_before><?php
namespace EDP\EventMonitorExtension\EventListener;

use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use EDP\EventMonitorExtension\Writer;

use Behat\Behat\Event\ScenarioEvent;
use Behat\Behat\Event\StepEvent;

use Edp\RedirectBundle\Driver\Selenium2Driver;

/**
 * Scenario event listener
 *
 * @author <NAME> <<EMAIL>>
 */
class ScenarioListener implements EventSubscriberInterface
{
    protected $debug;
    protected $tags = [];
    protected $featureTags = [];
    protected $outline = 0;
    protected $step = 0;

    public function __construct($outputFileType, $outputFileName, $debug)
    {
        $this->debug = $debug;
        $writerClass = '\\EDP\\EventMonitorExtension\\Writer\\' . ucfirst($outputFileType);
        if (class_exists($writerClass)) {
            $this->writer = new $writerClass($outputFileName);
        } else {
            throw new \Exception('Writer class ' . $writerClass . ' not found');
        }
    }

    public function valid()
    {
        $valid = in_array("javascript", $this->tags);
        /* $this->debug && fwrite(STDERR, "Tags are " . ($valid ?: "in") . "valid\n"); */
        /* $this->debug && fwrite(STDERR, var_export($this->tags, 1) . "\n"); */
        return $valid;
    }<commit_msg>file csv reset<commit_after><?php
namespace EDP\EventMonitorExtension\EventListener;

use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use EDP\EventMonitorExtension\Writer;

use Behat\Behat\Event\ScenarioEvent;
use Behat\Behat\Event\StepEvent;

use Edp\RedirectBundle\Driver\Selenium2Driver;

/**
 * Scenario event listener
 *
 * @author <NAME> <<EMAIL>>
 */
class ScenarioListener implements EventSubscriberInterface
{
    protected $debug;
    protected $tags = [];
    protected $featureTags = [];
    protected $outline = 0;
    protected $step = 0;

    public function __construct($outputFileType, $outputFileName, $debug)
    {
        $this->debug = $debug;
        $writerClass = '\\EDP\\EventMonitorExtension\\Writer\\' . ucfirst($outputFileType);
        if (class_exists($writerClass)) {
            $this->writer = new $writerClass($outputFileName);
        } else {
            throw new \Exception('Writer class ' . $writerClass . ' not found');
        }

        if ($outputFileType == 'csv') {
            `rm {$outputFileName}`;
            $data = ['date', 'scenario', 'outline no', 'step', 'step no', 'events'];
            $this->writer->write($data);
        }
    }

    public function valid()
    {
        $valid = in_array("javascript", $this->tags);
        /* $this->debug && fwrite(STDERR, "Tags are " . ($valid ?: "in") . "valid\n"); */
        /* $this->debug && fwrite(STDERR, var_export($this->tags, 1) . "\n"); */
        return $valid;
    }
{'fraction_non_alphanumeric': 0.15295815295815296, 'fraction_numerical': 0.002886002886002886, 'mean_word_length': 2.955777460770328, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 23, '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': '1462759', 'n_tokens_mistral': 837, 'n_tokens_neox': 813, 'n_words': 173}