<commit_before><?php
class Diablo3 {
    private $battlenet_tag;
    private $protocol          = 'http://';
    private $host              = '.battle.net';
    private $battlenet_servers = array('us', 'eu', 'sea', 'tw', 'kr');
    private $followerTypes     = array('enchantress', 'templar', 'scoundrel');
    private $artisanTypes      = array('blacksmith', 'jeweler');
    private $blizzardErrors    = array('OOPS', 'LIMITED', 'MAINTENANCE', 'NOTFOUND');
    private $career_url;
    private $hero_url;
    private $item_url;
    private $follower_url;
    private $artisan_url;

    public function __construct($battlenet_tag, $server = null) {
        if($battlenet_tag !== '') {
            $hash = strpos($battlenet_tag, '#');
            if($hash !== false) {
                $battlenet_tag = str_replace('#', '-', $battlenet_tag);
            }

            if(($server == null) || !in_array($server, $this->battlenet_servers, true)) {
                $server = 'us';
            }

            $battlenet_tag = urlencode(utf8_encode($battlenet_tag));

            //  Check if its a valid Battle.net tag (Pending)
            //
            /*if(!preg_match('/^.+(-[0-9]{4})/', $battlenet_tag)) {
                error_log("Battle.net tag provided not valid.");
                exit(0);
            }*/

            //  Set Variables
            //
            $this->battlenet_tag = (string)$battlenet_tag;
            $this->career_url    = $this->protocol.$server.$this->host.'/api/d3/profile/'.$this->battlenet_tag.'/index';
            $this->hero_url      = $this->protocol.$server.$this->host.'/api/d3/profile/'.$this->battlenet_tag.'/hero/';
        } else {
            error_log("Required Battle.net tag");
            exit(0);
        }

        $this->item_url     = $this->protocol.$server.$this->host.'/api/d3/data/item/';
        $this->follower_url = $this->protocol.$server.$this->host.'/api/d3/data/follower/';<commit_msg>utf8_encode not needed<commit_after><?php
class Diablo3 {
    private $battlenet_tag;
    private $protocol          = 'http://';
    private $host              = '.battle.net';
    private $battlenet_servers = array('us', 'eu', 'sea', 'tw', 'kr');
    private $followerTypes     = array('enchantress', 'templar', 'scoundrel');
    private $artisanTypes      = array('blacksmith', 'jeweler');
    private $blizzardErrors    = array('OOPS', 'LIMITED', 'MAINTENANCE', 'NOTFOUND');
    private $career_url;
    private $hero_url;
    private $item_url;
    private $follower_url;
    private $artisan_url;

    public function __construct($battlenet_tag, $server = null) {
        if($battlenet_tag !== '') {
            $hash = strpos($battlenet_tag, '#');
            if($hash !== false) {
                $battlenet_tag = str_replace('#', '-', $battlenet_tag);
            }

            if(($server == null) || !in_array($server, $this->battlenet_servers, true)) {
                $server = 'us';
            }

            $battlenet_tag = urlencode($battlenet_tag);

            //  Check if its a valid Battle.net tag (Pending)
            //
            /*if(!preg_match('/^.+(-[0-9]{4})/', $battlenet_tag)) {
                error_log("Battle.net tag provided not valid.");
                exit(0);
            }*/

            //  Set Variables
            //
            $this->battlenet_tag = (string)$battlenet_tag;
            $this->career_url    = $this->protocol.$server.$this->host.'/api/d3/profile/'.$this->battlenet_tag.'/index';
            $this->hero_url      = $this->protocol.$server.$this->host.'/api/d3/profile/'.$this->battlenet_tag.'/hero/';
        } else {
            error_log("Required Battle.net tag");
            exit(0);
        }

        $this->item_url     = $this->protocol.$server.$this->host.'/api/d3/data/item/';
        $this->follower_url = $this->protocol.$server.$this->host.'/api/d3/data/follower/';
{'fraction_non_alphanumeric': 0.17607802874743325, 'fraction_numerical': 0.005646817248459959, 'mean_word_length': 2.100238663484487, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 35, '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': '1962408', 'n_tokens_mistral': 1293, 'n_tokens_neox': 1272, 'n_words': 197}