<commit_before><?php
namespace TmlpStats\Import\Xlsx\DataImporter;

use TmlpStats\Accountability;
use TmlpStats\CenterStatsData;
use TmlpStats\Import\Xlsx\ImportDocument\ImportDocument;
use TmlpStats\Quarter;
use TmlpStats\TeamMember;
use TmlpStats\TeamMemberData;
use TmlpStats\WithdrawCode;

use Log;

class ClassListImporter extends DataImporterAbstract
{
    protected $sheetId = ImportDocument::TAB_CLASS_LIST;

    protected $totalTdos = 0;
    protected $totalTeamMembersDoingTdo = 0;
    protected $totalTeamMembers = 0;

    protected function populateSheetRanges()
    {
        $t1q4 = $this->findRange(25, 'Team 1 Completing', 'Team 2 Completing');
        $this->blocks['T1Q4']['cols'] = $this->excelRange('A', 'S');
        $this->blocks['T1Q4']['rows'] = $this->excelRange($t1q4['start'] + 1, $t1q4['end']);

        $t2q4 = $this->findRange($t1q4['end'], 'Team 2 Completing', 'Current Team Completing');
        $this->blocks['T2Q4']['cols'] = $this->excelRange('A', 'S');
        $this->blocks['T2Q4']['rows'] = $this->excelRange($t2q4['start'] + 1, $t2q4['end']);

        $t1q3 = $this->findRange($t2q4['end'], 'Team 1 Completing', 'Team 2 Completing');
        $this->blocks['T1Q3']['cols'] = $this->excelRange('A', 'S');
        $this->blocks['T1Q3']['rows'] = $this->excelRange($t1q3['start'] + 1, $t1q3['end']);

        $t2q3 = $this->findRange($t1q3['end'], 'Team 2 Completing', 'Current Team Completing');
        $this->blocks['T2Q3']['cols'] = $this->excelRange('A', 'S');
        $this->blocks['T2Q3']['rows'] = $this->excelRange($t2q3['start'] + 1, $t2q3['end']);

        $t1q2 = $this->findRange($t2q3['end'], 'Team 1 Completing', 'Team 2 Completing');
        $this->blocks['T1Q2']['cols'] = $this->excelRange('A', 'S');
        $this->blocks['T1Q2']['rows'] = $this->excelRange($t1q2['start'] + 1, $t1q2['end']);

        $t2q2 = $this->findRange($t1q2['end'], 'Team 2 Completing', 'Current Team Completing');
        $this->blocks['T2Q2']['cols'] = $this->excelRange('A', 'S');
        $this->blocks['T2Q2']['rows'] = $this->excelRange($t2q2['start'] + 1, $t2q2['end']);

        $t1q1 = $this->findRange($t2q2['end'], 'Team 1 Completing', 'Team 2 Completing');
        $this->blocks['T1Q1']['cols'] = $this->excelRange('A', 'S');
        $this->blocks['T1Q1']['rows'] = $this->excelRange($t1q1['start'] + 1, $t1q1['end']);

        $t2q1 = $this->findRange($t1q1['end'], 'Team 2 Completing', [
            'Please e-mail the completed performance report to your Regional Statistician(s)', // ANZ/EME/IND
            'Please upload accurate and complete sheet to Validator by 7pm Friday each week.', // NA
        ]);
        $this->blocks['T2Q1']['cols'] = $this->excelRange('A', 'S');
        $this->blocks['T2Q1']['rows'] = $this->excelRange($t2q1['start'] + 1, $t2q1['end']);
    }

    protected function load()
    {
        $this->reader = $this->getReader($this->sheet);

        $this->loadBlock($this->blocks['T1Q4'], 1);
        $this->loadBlock($this->blocks['T2Q4'], 2);
        $this->loadBlock($this->blocks['T1Q3'], 1);
        $this->loadBlock($this->blocks['T2Q3'], 2);
        $this->loadBlock($this->blocks['T1Q2'], 1);
        $this->loadBlock($this->blocks['T2Q2'], 2);
        $this->loadBlock($this->blocks['T1Q1'], 1);
        $this->loadBlock($this->blocks['T2Q1'], 2);
    }

    protected function loadBlock($blockParams, $teamYear = NULL)
    {
        foreach ($blockParams['rows'] as $row) {
<commit_msg>Fix the text used to find the end of the classlist for EME and ANZ<commit_after><?php
namespace TmlpStats\Import\Xlsx\DataImporter;

use TmlpStats\Accountability;
use TmlpStats\CenterStatsData;
use TmlpStats\Import\Xlsx\ImportDocument\ImportDocument;
use TmlpStats\Quarter;
use TmlpStats\TeamMember;
use TmlpStats\TeamMemberData;
use TmlpStats\WithdrawCode;

use Log;

class ClassListImporter extends DataImporterAbstract
{
    protected $sheetId = ImportDocument::TAB_CLASS_LIST;

    protected $totalTdos = 0;
    protected $totalTeamMembersDoingTdo = 0;
    protected $totalTeamMembers = 0;

    protected function populateSheetRanges()
    {
        $t1q4 = $this->findRange(25, 'Team 1 Completing', 'Team 2 Completing');
        $this->blocks['T1Q4']['cols'] = $this->excelRange('A', 'S');
        $this->blocks['T1Q4']['rows'] = $this->excelRange($t1q4['start'] + 1, $t1q4['end']);

        $t2q4 = $this->findRange($t1q4['end'], 'Team 2 Completing', 'Current Team Completing');
        $this->blocks['T2Q4']['cols'] = $this->excelRange('A', 'S');
        $this->blocks['T2Q4']['rows'] = $this->excelRange($t2q4['start'] + 1, $t2q4['end']);

        $t1q3 = $this->findRange($t2q4['end'], 'Team 1 Completing', 'Team 2 Completing');
        $this->blocks['T1Q3']['cols'] = $this->excelRange('A', 'S');
        $this->blocks['T1Q3']['rows'] = $this->excelRange($t1q3['start'] + 1, $t1q3['end']);

        $t2q3 = $this->findRange($t1q3['end'], 'Team 2 Completing', 'Current Team Completing');
        $this->blocks['T2Q3']['cols'] = $this->excelRange('A', 'S');
        $this->blocks['T2Q3']['rows'] = $this->excelRange($t2q3['start'] + 1, $t2q3['end']);

        $t1q2 = $this->findRange($t2q3['end'], 'Team 1 Completing', 'Team 2 Completing');
        $this->blocks['T1Q2']['cols'] = $this->excelRange('A', 'S');
        $this->blocks['T1Q2']['rows'] = $this->excelRange($t1q2['start'] + 1, $t1q2['end']);

        $t2q2 = $this->findRange($t1q2['end'], 'Team 2 Completing', 'Current Team Completing');
        $this->blocks['T2Q2']['cols'] = $this->excelRange('A', 'S');
        $this->blocks['T2Q2']['rows'] = $this->excelRange($t2q2['start'] + 1, $t2q2['end']);

        $t1q1 = $this->findRange($t2q2['end'], 'Team 1 Completing', 'Team 2 Completing');
        $this->blocks['T1Q1']['cols'] = $this->excelRange('A', 'S');
        $this->blocks['T1Q1']['rows'] = $this->excelRange($t1q1['start'] + 1, $t1q1['end']);

        $t2q1 = $this->findRange($t1q1['end'], 'Team 2 Completing', [
            'Please e-mail the completed performance report to your Regional Statistician(s)', // ANZ/EME/IND
            'Please submit through the Validator the completed performance report', // ANZ/EME/IND
            'Please upload accurate and complete sheet to Validator by 7pm Friday each week.', // NA
        ]);
        $this->blocks['T2Q1']['cols'] = $this->excelRange('A', 'S');
        $this->blocks['T2Q1']['rows'] = $this->excelRange($t2q1['start'] + 1, $t2q1['end']);
    }

    protected function load()
    {
        $this->reader = $this->getReader($this->sheet);

        $this->loadBlock($this->blocks['T1Q4'], 1);
        $this->loadBlock($this->blocks['T2Q4'], 2);
        $this->loadBlock($this->blocks['T1Q3'], 1);
        $this->loadBlock($this->blocks['T2Q3'], 2);
        $this->loadBlock($this->blocks['T1Q2'], 1);
        $this->loadBlock($this->blocks['T2Q2'], 2);
        $this->loadBlock($this->blocks['T1Q1'], 1);
        $this->loadBlock($this->blocks['T2Q1'], 2);
    }

    protected function loadBlock($blockParams, $teamYear = NULL)
    {
        foreach ($blockParams['rows'] as $row) {

{'fraction_non_alphanumeric': 0.2203891708967851, 'fraction_numerical': 0.04060913705583756, 'mean_word_length': 3.878266850068776, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 121, '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': '4225864', 'n_tokens_mistral': 2666, 'n_tokens_neox': 2571, 'n_words': 444}