<commit_before><div class="index">
    <h2><?php echo h($title); ?></h2>
    <?php
        $event_id = $event['Event']['id'];
        $url = '/events/handleModuleResults/' . $event_id;
        echo $this->Form->create('Event', array('url' => $url, 'class' => 'mainForm'));
        $formSettings = array(
            'type' => 'hidden',
            'value' => json_encode($event, true)
        );
        echo $this->Form->input('data', $formSettings);
        echo $this->Form->input('JsonObject', array(
                'label' => false,
                'type' => 'text',
                'style' => 'display:none;',
                'value' => ''
        ));
        echo $this->Form->input('default_comment', array(
                'label' => false,
                'type' => 'text',
                'style' => 'display:none;',
                'value' => $importComment
        ));
        echo $this->Form->end();
        $objects_array = array();
        foreach (array('Attribute', 'Object') as $field) {
            if (!empty($event[$field])) {
                $objects_array[] = strtolower($field) . 's';
            }
        }
        if (empty($objects_array)) {
            echo '<p>Results from the enrichment module for this attribute are empty.</p>';
        } else {
            $scope = join(' and ', $objects_array);
            echo '<p>Below you can see the ' . $scope . ' that are to be created from the results of the enrichment module.</p>';
            $table_data = array(
                array('key' => __('Event ID'), 'value' => $event['Event']['id']),
                array('key' => __('Event UUID'), 'value' => $event['Event']['uuid']),
                array('key' => __('Event creator org'), 'html' => sprintf(
                    '<a href=%s/organisations/view/%s>%s</a>',
                    $baseurl,
                    h($event['Event']['orgc_id']),
                    h($event['Event']['orgc_name'])
                )),
                array('key' => __('Event info'), 'value' => $event['Event']['info'])
            );
            $attributes_count = isset($event['Attribute']) ? count($event['Attribute']) : 0;
            $objects_count = isset($event['Object']) ? count($event['Object']) : 0;
            if (!empty($event['Object'])) {
                foreach ($event['Object'] as $object) {
                    if (!empty($object['Attribute'])) {<commit_msg>fix: [enrichment view] Testing if event metadata elements exist before displaying them<commit_after><div class="index">
    <h2><?php echo h($title); ?></h2>
    <?php
        $event_id = $event['Event']['id'];
        $url = '/events/handleModuleResults/' . $event_id;
        echo $this->Form->create('Event', array('url' => $url, 'class' => 'mainForm'));
        $formSettings = array(
            'type' => 'hidden',
            'value' => json_encode($event, true)
        );
        echo $this->Form->input('data', $formSettings);
        echo $this->Form->input('JsonObject', array(
                'label' => false,
                'type' => 'text',
                'style' => 'display:none;',
                'value' => ''
        ));
        echo $this->Form->input('default_comment', array(
                'label' => false,
                'type' => 'text',
                'style' => 'display:none;',
                'value' => $importComment
        ));
        echo $this->Form->end();
        $objects_array = array();
        foreach (array('Attribute', 'Object') as $field) {
            if (!empty($event[$field])) {
                $objects_array[] = strtolower($field) . 's';
            }
        }
        if (empty($objects_array)) {
            echo '<p>Results from the enrichment module for this attribute are empty.</p>';
        } else {
            $scope = join(' and ', $objects_array);
            echo '<p>Below you can see the ' . $scope . ' that are to be created from the results of the enrichment module.</p>';
            $table_data = array(array('key' => __('Event ID'), 'value' => $event_id));
            $event_metadata = $event['Event'];
            if (!empty($event_metadata['uuid'])) {
                $table_data[] = array('key' => __('Event UUID'),
                                      'value' => $event_metadata['uuid']);
            }
            if (!empty($event_metadata['orgc_id']) && !empty($event_metadata['orgc_name'])) {
                $table_data[] = array('key' => __('Event creator org'), 'html' => sprintf(
                    '<a href=%s/organisations/view/%s>%s</a>',
                    $baseurl,
                    h($event['Event']['orgc_id']),
                    h($event['Event']['orgc_name'])
                ));
            }
            if (!empty($event_metadata['info'])) {
                array('key' => __('Event info'), 'value' => $event['Event']['info']);
            }
            $attributes_count = isset($event['Attribute']) ? count($event['Attribute']) : 0;
            $objects_count = isset($event['Object']) ? count($event['Object']) : 0;
            if (!empty($event['Object'])) {
                foreach ($event['Object'] as $object) {
                    if (!empty($object['Attribute'])) {
{'fraction_non_alphanumeric': 0.19301966833783263, 'fraction_numerical': 0.0015426147319706903, 'mean_word_length': 1.8578512396694216, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 83, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1546498', 'n_tokens_mistral': 1445, 'n_tokens_neox': 1402, 'n_words': 309}