<commit_before># Python Version: 3.x
"""
the module for Kattis (http://open.kattis.org/)
"""

import io
import re
import urllib.parse
import zipfile
from typing import *

import bs4
import requests

import onlinejudge._implementation.logging as log
import onlinejudge._implementation.testcase_zipper
import onlinejudge._implementation.utils as utils
import onlinejudge.dispatch
import onlinejudge.type
from onlinejudge.type import TestCase


class KattisService(onlinejudge.type.Service):
    def get_url(self) -> str:
        """
        :note: sometimes this URL is not correct, i.e. something like https://hanoi18.kattis.com/ exists
        """

        return 'http://open.kattis.org/'

    def get_name(self) -> str:
        return 'Kattis'

    @classmethod
    def from_url(cls, url: str) -> Optional['KattisService']:
        # example: https://open.kattis.com/
        # example: https://hanoi18.kattis.com/
        result = urllib.parse.urlparse(url)
        if result.scheme in ('', 'http', 'https') \
                and result.netloc.endswith('.kattis.com'):
            # NOTE: ignore the subdomain
            return cls()
        return None


class KattisProblem(onlinejudge.type.Problem):<commit_msg>NONE: fix a typo of a URL of Kattis<commit_after># Python Version: 3.x
"""
the module for Kattis (https://open.kattis.com/)
"""

import io
import re
import urllib.parse
import zipfile
from typing import *

import bs4
import requests

import onlinejudge._implementation.logging as log
import onlinejudge._implementation.testcase_zipper
import onlinejudge._implementation.utils as utils
import onlinejudge.dispatch
import onlinejudge.type
from onlinejudge.type import TestCase


class KattisService(onlinejudge.type.Service):
    def get_url(self) -> str:
        """
        :note: sometimes this URL is not correct, i.e. something like https://hanoi18.kattis.com/ exists
        """

        return 'https://open.kattis.com/'

    def get_name(self) -> str:
        return 'Kattis'

    @classmethod
    def from_url(cls, url: str) -> Optional['KattisService']:
        # example: https://open.kattis.com/
        # example: https://hanoi18.kattis.com/
        result = urllib.parse.urlparse(url)
        if result.scheme in ('', 'http', 'https') \
                and result.netloc.endswith('.kattis.com'):
            # NOTE: ignore the subdomain
            return cls()
        return None


class KattisProblem(onlinejudge.type.Problem):
{'fraction_non_alphanumeric': 0.11097560975609756, 'fraction_numerical': 0.004878048780487805, 'mean_word_length': 2.9502407704654896, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 8, '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': '1855457', 'n_tokens_mistral': 785, 'n_tokens_neox': 736, 'n_words': 197}