<commit_before><?hh

require_once 'quizzer/Assessment.hh';
require_once 'quizzer/deserializers/AssessmentDeserializer.hh';

class AssessmentLoader {
  
    public static function loadAssessmentFromUrls(string $questionsUrl,
            string $answersUrl, ?string $gradesUrl): Assessment {
        if (!isset($questionsUrl) || !isset($answersUrl)) {
            throw new Exception('Questions and answers URLs cannot be null');
        }

        $questionsJson = file_get_contents($questionsUrl);
        $answersJson = file_get_contents($answersUrl);

        $gradesJson = null;
        if (!isset($gradesUrl)) {
            $gradesJson = file_get_contents($gradesUrl);
        }

        return self::createAssessment($questionsJson, $answersJson, $gradesJson);
    }

    public static function loadAssessmentFromJsons(string $questionsJson,
            string $answersJson, ?string $gradesJson): Assessment {
        if (!isset($questionsJson) || !isset($answersJson)) {
            throw new Exception('Questions and answers URLs cannot be null');
        }

        return self::createAssessment($questionsJson, $answersJson, $gradesJson);
    }<commit_msg>Replace empty with isset<commit_after><?hh

require_once 'quizzer/Assessment.hh';
require_once 'quizzer/deserializers/AssessmentDeserializer.hh';

class AssessmentLoader {

    public static function loadAssessmentFromUrls(string $questionsUrl,
            string $answersUrl, ?string $gradesUrl): Assessment {
        if (!isset($questionsUrl) || !isset($answersUrl)) {
            throw new Exception('Questions and answers URLs cannot be null');
        }

        $questionsJson = file_get_contents($questionsUrl);
        $answersJson = file_get_contents($answersUrl);

        $gradesJson = null;
        if (!empty($gradesUrl)) {
            $gradesJson = file_get_contents($gradesUrl);
        }

        return self::createAssessment($questionsJson, $answersJson, $gradesJson);
    }

    public static function loadAssessmentFromJsons(string $questionsJson,
            string $answersJson, ?string $gradesJson): Assessment {
        if (!isset($questionsJson) || !isset($answersJson)) {
            throw new Exception('Questions and answers URLs cannot be null');
        }

        return self::createAssessment($questionsJson, $answersJson, $gradesJson);
    }
{'fraction_non_alphanumeric': 0.10773834972210346, 'fraction_numerical': 0.0, 'mean_word_length': 3.4150943396226414, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '4422352', 'n_tokens_mistral': 669, 'n_tokens_neox': 613, 'n_words': 145}