<commit_before><?php

/**
 * Country
 */

namespace CountryCode;

require dirname(__DIR__) . "/vendor/autoload.php";

class Country extends Common {

    /**
     * 
     * @param string $countryCode
     */
    public function Setup($countryCode) {
        if ($this->CheckCountryInCsv($countryCode)) {
            parent::__set('country', $countryCode);
        }
    }

    /**
     * 
     * @param string $country
     * @return boolean
     */
    public function CheckCountryInCsv($country) {
        $content = file_get_contents(BASE_PATH . "/country-list.csv");<commit_msg>check the country exists in CSV<commit_after><?php

/**
 * Country
 */

namespace CountryCode;

require dirname(__DIR__) . "/vendor/autoload.php";

class Country extends Common {

    /**
     * 
     * @param string $countryCode
     */
    public function Setup($countryCode) {
        if ($this->CheckCountryInCsv($countryCode)) {
            parent::__set('country', $countryCode);
        }
    }

    /**
     * 
     * @param string $country
     * @return boolean
     */
    public function CheckCountryInCsv($country) {
        $content = array_map('str_getcsv', file(BASE_PATH . "/country-list.csv"));

        foreach ($content as $key => $row) {
            $row = explode(";", $row[0]);
            if ($row[1] == $country || $row[2] == $country) {
                if ($key > 0) {
                    return true;
                } else {
                    return false;
                }
            }
        }
{'fraction_non_alphanumeric': 0.14304635761589404, 'fraction_numerical': 0.0026490066225165563, 'mean_word_length': 1.9113680154142583, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '1017106', 'n_tokens_mistral': 447, 'n_tokens_neox': 432, 'n_words': 90}