





import os
import pickle
import unittest

from transformers import AutoTokenizer
from transformers.models.bert.tokenization_bert import BertTokenizer
from transformers.models.bert_japanese.tokenization_bert_japanese import (
    VOCAB_FILES_NAMES,
    BertJapaneseTokenizer,
    CharacterTokenizer,
    JumanppTokenizer,
    MecabTokenizer,
    SudachiTokenizer,
    WordpieceTokenizer,
)
from transformers.testing_utils import custom_tokenizers, require_jumanpp, require_sudachi

from ...test_tokenization_common import TokenizerTesterMixin







@custom_tokenizers
class     __lowerCAmelCase	(   UpperCamelCase__						,    unittest.TestCase):
      _lowercase    : Any            =      BertJapaneseTokenizer
      _lowercase    : List[Any]            =      False
      _lowercase    : Tuple            =      True







      def        _lowercase  (   self							)       ->						Optional[int]:



        '''simple docstring'''




        super().setUp()

        a__     : Optional[int]  =[
            "[UNK]",
            "[CLS]",
            "[SEP]",
            "こんにちは",
            "こん",
            "にちは",
            "ばんは",
            "##こん",
            "##にちは",
            "##ばんは",
            "世界",
            "##世界",
            "、",
            "##、",
            "。",
            "##。",
        ]

        a__     : Dict  =os.path.join(self.tmpdirname		,				VOCAB_FILES_NAMES["vocab_file"]							)
        with open(self.vocab_file		,				"w"		,				encoding="utf-8"							) as vocab_writer:
          vocab_writer.write("".join([x + "\n" for x in vocab_tokens]							)							)







      def        _lowercase  (   self		,				lowerCAmelCase__							)       ->						Optional[Any]:



        '''simple docstring'''




        a__     : Tuple  ="こんにちは、世界。 \nこんばんは、世界。"
        a__     : Any  ="こんにちは 、 世界 。 こんばんは 、 世界 。"
        return input_text, output_text







      def        _lowercase  (   self		,				lowerCAmelCase__							)       ->						Union[str, Any]:



        '''simple docstring'''




        a__     : List[Any]  =self.get_input_output_texts(lowerCAmelCase__							)
        a__     : Union[str, Any]  =tokenizer.encode(lowerCAmelCase__		,				add_special_tokens=lowerCAmelCase__							)
        a__     : Any  =tokenizer.decode(lowerCAmelCase__		,				clean_up_tokenization_spaces=lowerCAmelCase__							)
        return text, ids







      def        _lowercase  (   self							)       ->						int:



        '''simple docstring'''




        pass  # TODO add if relevant







      def        _lowercase  (   self							)       ->						Optional[Any]:



        '''simple docstring'''




        pass  # TODO add if relevant







      def        _lowercase  (   self							)       ->						Optional[int]:



        '''simple docstring'''




        pass  # TODO add if relevant







      def        _lowercase  (   self							)       ->						Any:



        '''simple docstring'''




        a__     : int  =self.tokenizer_class(self.vocab_file							)

        a__     : int  =tokenizer.tokenize("こんにちは、世界。\nこんばんは、世界。"							)
        self.assertListEqual(lowerCAmelCase__		,				["こんにちは", "、", "世界", "。", "こん", "##ばんは", "、", "世界", "。"]							)
        self.assertListEqual(tokenizer.convert_tokens_to_ids(lowerCAmelCase__							)		,				[3, 1_2, 1_0, 1_4, 4, 9, 1_2, 1_0, 1_4]							)







      def        _lowercase  (   self							)       ->						Any:



        '''simple docstring'''




        a__     : List[str]  =self.tokenizer_class(self.vocab_file		,				word_tokenizer_type="mecab"							)
        self.assertIsNotNone(lowerCAmelCase__							)

        a__     : List[Any]  ="こんにちは、世界。\nこんばんは、世界。"
        a__     : int  =tokenizer.tokenize(lowerCAmelCase__							)
        self.assertListEqual(lowerCAmelCase__		,				["こんにちは", "、", "世界", "。", "こん", "##ばんは", "、", "世界", "。"]							)
        self.assertListEqual(tokenizer.convert_tokens_to_ids(lowerCAmelCase__							)		,				[3, 1_2, 1_0, 1_4, 4, 9, 1_2, 1_0, 1_4]							)

        a__     : Any  =os.path.join(self.tmpdirname		,				"tokenizer.bin"							)
        with open(lowerCAmelCase__		,				"wb"							) as handle:
          pickle.dump(lowerCAmelCase__		,				lowerCAmelCase__							)

        with open(lowerCAmelCase__		,				"rb"							) as handle:
          a__     : List[Any]  =pickle.load(lowerCAmelCase__							)

        a__     : Tuple  =tokenizer_new.tokenize(lowerCAmelCase__							)

        self.assertListEqual(lowerCAmelCase__		,				lowerCAmelCase__							)







      def        _lowercase  (   self							)       ->						Union[str, Any]:



        '''simple docstring'''




        a__     : Dict  =MecabTokenizer(mecab_dic="ipadic"							)

        self.assertListEqual(
            tokenizer.tokenize(" \tｱｯﾌﾟﾙストアでiPhone８ が  \n 発売された　。  "							)		,				["アップルストア", "で", "iPhone", "8", "が", "発売", "さ", "れ", "た", "。"]		,				)







      def        _lowercase  (   self							)       ->						Optional[Any]:



        '''simple docstring'''




        try:
          a__     : int  =MecabTokenizer(mecab_dic="unidic_lite"							)
        except ModuleNotFoundError:
          return

        self.assertListEqual(
            tokenizer.tokenize(" \tｱｯﾌﾟﾙストアでiPhone８ が  \n 発売された　。  "							)		,				["アップル", "ストア", "で", "iPhone", "8", "が", "発売", "さ", "れ", "た", "。"]		,				)







      def        _lowercase  (   self							)       ->						int:



        '''simple docstring'''




        try:
          a__     : List[str]  =MecabTokenizer(mecab_dic="unidic"							)
        except ModuleNotFoundError:
          return

        self.assertListEqual(
            tokenizer.tokenize(" \tｱｯﾌﾟﾙストアでiPhone８ が  \n 発売された　。  "							)		,				["アップル", "ストア", "で", "iPhone", "8", "が", "発売", "さ", "れ", "た", "。"]		,				)







      def        _lowercase  (   self							)       ->						Any:



        '''simple docstring'''




        a__     : int  =MecabTokenizer(do_lower_case=lowerCAmelCase__		,				mecab_dic="ipadic"							)

        self.assertListEqual(
            tokenizer.tokenize(" \tｱｯﾌﾟﾙストアでiPhone８ が  \n 発売された　。  "							)		,				["アップルストア", "で", "iphone", "8", "が", "発売", "さ", "れ", "た", "。"]		,				)







      def        _lowercase  (   self							)       ->						Optional[int]:



        '''simple docstring'''




        try:
          a__     : Any  =MecabTokenizer(
              do_lower_case=lowerCAmelCase__		,				normalize_text=lowerCAmelCase__		,				mecab_option="-d /usr/local/lib/mecab/dic/jumandic"							)
        except RuntimeError:
          # if dict doesn't exist in the system, previous code raises this error.
          return

        self.assertListEqual(
            tokenizer.tokenize(" \tｱｯﾌﾟﾙストアでiPhone８ が  \n 発売された　。  "							)		,				["ｱｯﾌﾟﾙストア", "で", "iPhone", "８", "が", "発売", "さ", "れた", "\u3000", "。"]		,				)







      def        _lowercase  (   self							)       ->						List[Any]:



        '''simple docstring'''




        a__     : str  =MecabTokenizer(normalize_text=lowerCAmelCase__		,				mecab_dic="ipadic"							)

        self.assertListEqual(
            tokenizer.tokenize(" \tｱｯﾌﾟﾙストアでiPhone８ が  \n 発売された　。  "							)		,				["ｱｯﾌﾟﾙストア", "で", "iPhone", "８", "が", "発売", "さ", "れ", "た", "　", "。"]		,				)







      @require_sudachi
      def        _lowercase  (   self							)       ->						Any:



        '''simple docstring'''




        a__     : Optional[int]  =self.tokenizer_class(self.vocab_file		,				word_tokenizer_type="sudachi"							)
        self.assertIsNotNone(lowerCAmelCase__							)

        a__     : str  ="こんにちは、世界。\nこんばんは、世界。"
        a__     : Optional[Any]  =tokenizer.tokenize(lowerCAmelCase__							)
        self.assertListEqual(lowerCAmelCase__		,				["こんにちは", "、", "世界", "。", "こん", "##ばんは", "、", "世界", "。"]							)
        self.assertListEqual(tokenizer.convert_tokens_to_ids(lowerCAmelCase__							)		,				[3, 1_2, 1_0, 1_4, 4, 9, 1_2, 1_0, 1_4]							)

        a__     : Dict  =os.path.join(self.tmpdirname		,				"tokenizer.bin"							)
        with open(lowerCAmelCase__		,				"wb"							) as handle:
          pickle.dump(lowerCAmelCase__		,				lowerCAmelCase__							)

        with open(lowerCAmelCase__		,				"rb"							) as handle:
          a__     : Any  =pickle.load(lowerCAmelCase__							)

        a__     : Tuple  =tokenizer_new.tokenize(lowerCAmelCase__							)

        self.assertListEqual(lowerCAmelCase__		,				lowerCAmelCase__							)







      @require_sudachi
      def        _lowercase  (   self							)       ->						str:



        '''simple docstring'''




        a__     : Optional[int]  =SudachiTokenizer(sudachi_dict_type="core"							)

        self.assertListEqual(
            tokenizer.tokenize(" \tｱｯﾌﾟﾙストアでiPhone８ が  \n 発売された　。  "							)		,				[" ", "\t", "アップル", "ストア", "で", "iPhone", "8", " ", "が", " ", " ", "\n ", "発売", "さ", "れ", "た", " ", "。", " ", " "]		,				)







      @require_sudachi
      def        _lowercase  (   self							)       ->						Dict:



        '''simple docstring'''




        a__     : Union[str, Any]  =SudachiTokenizer(sudachi_dict_type="core"		,				sudachi_split_mode="A"							)

        self.assertListEqual(tokenizer.tokenize("外国人参政権"							)		,				["外国", "人", "参政", "権"]							)







      @require_sudachi
      def        _lowercase  (   self							)       ->						Any:



        '''simple docstring'''




        a__     : Optional[int]  =SudachiTokenizer(sudachi_dict_type="core"		,				sudachi_split_mode="B"							)

        self.assertListEqual(tokenizer.tokenize("外国人参政権"							)		,				["外国人", "参政権"]							)







      @require_sudachi
      def        _lowercase  (   self							)       ->						Dict:



        '''simple docstring'''




        a__     : Any  =SudachiTokenizer(sudachi_dict_type="core"		,				sudachi_split_mode="C"							)

        self.assertListEqual(tokenizer.tokenize("外国人参政権"							)		,				["外国人参政権"]							)







      @require_sudachi
      def        _lowercase  (   self							)       ->						str:



        '''simple docstring'''




        a__     : Union[str, Any]  =SudachiTokenizer(do_lower_case=lowerCAmelCase__		,				sudachi_dict_type="core"							)

        self.assertListEqual(
            tokenizer.tokenize(" \tｱｯﾌﾟﾙストアでiPhone８ が  \n 発売された　。  "							)		,				[" ", "\t", "アップル", "ストア", "で", "iphone", "8", " ", "が", " ", " ", "\n ", "発売", "さ", "れ", "た", " ", "。", " ", " "]		,				)







      @require_sudachi
      def        _lowercase  (   self							)       ->						Optional[int]:



        '''simple docstring'''




        a__     : int  =SudachiTokenizer(normalize_text=lowerCAmelCase__		,				sudachi_dict_type="core"							)

        self.assertListEqual(
            tokenizer.tokenize(" \tｱｯﾌﾟﾙストアでiPhone８ が  \n 発売された　。  "							)		,				[" ", "\t", "ｱｯﾌﾟﾙ", "ストア", "で", "iPhone", "８", " ", "が", " ", " ", "\n ", "発売", "さ", "れ", "た", "\u3000", "。", " ", " "]		,				)







      @require_sudachi
      def        _lowercase  (   self							)       ->						Optional[int]:



        '''simple docstring'''




        a__     : Optional[int]  =SudachiTokenizer(trim_whitespace=lowerCAmelCase__		,				sudachi_dict_type="core"							)

        self.assertListEqual(
            tokenizer.tokenize(" \tｱｯﾌﾟﾙストアでiPhone８ が  \n 発売された　。  "							)		,				["アップル", "ストア", "で", "iPhone", "8", "が", "発売", "さ", "れ", "た", "。"]		,				)







      @require_jumanpp
      def        _lowercase  (   self							)       ->						Optional[Any]:



        '''simple docstring'''




        a__     : List[Any]  =self.tokenizer_class(self.vocab_file		,				word_tokenizer_type="jumanpp"							)
        self.assertIsNotNone(lowerCAmelCase__							)

        a__     : Dict  ="こんにちは、世界。\nこんばんは、世界。"
        a__     : List[Any]  =tokenizer.tokenize(lowerCAmelCase__							)
        self.assertListEqual(lowerCAmelCase__		,				["こんにちは", "、", "世界", "。", "こん", "##ばんは", "、", "世界", "。"]							)
        self.assertListEqual(tokenizer.convert_tokens_to_ids(lowerCAmelCase__							)		,				[3, 1_2, 1_0, 1_4, 4, 9, 1_2, 1_0, 1_4]							)

        a__     : Any  =os.path.join(self.tmpdirname		,				"tokenizer.bin"							)
        with open(lowerCAmelCase__		,				"wb"							) as handle:
          pickle.dump(lowerCAmelCase__		,				lowerCAmelCase__							)

        with open(lowerCAmelCase__		,				"rb"							) as handle:
          a__     : str  =pickle.load(lowerCAmelCase__							)

        a__     : str  =tokenizer_new.tokenize(lowerCAmelCase__							)

        self.assertListEqual(lowerCAmelCase__		,				lowerCAmelCase__							)







      @require_jumanpp
      def        _lowercase  (   self							)       ->						int:



        '''simple docstring'''




        a__     : Optional[Any]  =JumanppTokenizer()

        self.assertListEqual(
            tokenizer.tokenize(" \tｱｯﾌﾟﾙストアでiPhone８ が  \n 発売された　。  "							)		,				["アップル", "ストア", "で", "iPhone", "8", "\u3000", "が", "\u3000", "\u3000", "\u3000", "発売", "さ", "れた", "\u3000", "。"]		,				)







      @require_jumanpp
      def        _lowercase  (   self							)       ->						List[str]:



        '''simple docstring'''




        a__     : Union[str, Any]  =JumanppTokenizer(do_lower_case=lowerCAmelCase__							)

        self.assertListEqual(
            tokenizer.tokenize(" \tｱｯﾌﾟﾙストアでiPhone８ が  \n 発売された　。  "							)		,				["アップル", "ストア", "で", "iphone", "8", "\u3000", "が", "\u3000", "\u3000", "\u3000", "発売", "さ", "れた", "\u3000", "。"]		,				)







      @require_jumanpp
      def        _lowercase  (   self							)       ->						Tuple:



        '''simple docstring'''




        a__     : int  =JumanppTokenizer(normalize_text=lowerCAmelCase__							)

        self.assertListEqual(
            tokenizer.tokenize(" \tｱｯﾌﾟﾙストアでiPhone８ が  \n 発売された　。  "							)		,				["ｱ", "ｯ", "ﾌ", "ﾟ", "ﾙ", "ストア", "で", "iPhone", "８", "\u3000", "が", "\u3000", "\u3000", "\u3000", "発売", "さ", "れた", "\u3000", "。"]		,				)







      @require_jumanpp
      def        _lowercase  (   self							)       ->						List[Any]:



        '''simple docstring'''




        a__     : Tuple  =JumanppTokenizer(trim_whitespace=lowerCAmelCase__							)

        self.assertListEqual(
            tokenizer.tokenize(" \tｱｯﾌﾟﾙストアでiPhone８ が  \n 発売された　。  "							)		,				["アップル", "ストア", "で", "iPhone", "8", "が", "発売", "さ", "れた", "。"]		,				)







      @require_jumanpp
      def        _lowercase  (   self							)       ->						Optional[Any]:



        '''simple docstring'''




        a__     : Optional[Any]  =JumanppTokenizer()

        self.assertListEqual(
            tokenizer.tokenize("ありがとうございますm(_ _)ｍ見つけるのが大変です。"							)		,				["ありがとう", "ございます", "m(_ _)m", "見つける", "の", "が", "大変です", "。"]		,				)







      def        _lowercase  (   self							)       ->						Union[str, Any]:



        '''simple docstring'''




        a__     : Any  =["[UNK]", "[CLS]", "[SEP]", "こんにちは", "こん", "にちは", "ばんは", "##こん", "##にちは", "##ばんは"]

        a__     : int  ={}
        for i, token in enumerate(lowerCAmelCase__							):
          a__     : Optional[int]  =i
        a__     : List[Any]  =WordpieceTokenizer(vocab=lowerCAmelCase__		,				unk_token="[UNK]"							)

        self.assertListEqual(tokenizer.tokenize(""							)		,				[]							)

        self.assertListEqual(tokenizer.tokenize("こんにちは"							)		,				["こんにちは"]							)

        self.assertListEqual(tokenizer.tokenize("こんばんは"							)		,				["こん", "##ばんは"]							)

        self.assertListEqual(tokenizer.tokenize("こんばんは こんばんにちは こんにちは"							)		,				["こん", "##ばんは", "[UNK]", "こんにちは"]							)







      def        _lowercase  (   self							)       ->						Any:



        '''simple docstring'''




        a__     : Optional[Any]  =BertJapaneseTokenizer.from_pretrained("nlp-waseda/roberta-base-japanese-with-auto-jumanpp"							)
        a__     : Any  =tokenizer.subword_tokenizer

        a__     : Dict  =subword_tokenizer.tokenize("国境 の 長い トンネル を 抜ける と 雪国 であった 。"							)
        self.assertListEqual(lowerCAmelCase__		,				["▁国境", "▁の", "▁長い", "▁トンネル", "▁を", "▁抜ける", "▁と", "▁雪", "国", "▁であった", "▁。"]							)

        a__     : List[Any]  =subword_tokenizer.tokenize("こんばんは こんばん にち は こんにちは"							)
        self.assertListEqual(lowerCAmelCase__		,				["▁こん", "ばん", "は", "▁こん", "ばん", "▁に", "ち", "▁は", "▁こんにちは"]							)







      def        _lowercase  (   self							)       ->						Dict:



        '''simple docstring'''




        a__     : List[str]  =self.tokenizer_class.from_pretrained("cl-tohoku/bert-base-japanese"							)

        a__     : Union[str, Any]  =tokenizer.encode("ありがとう。"		,				add_special_tokens=lowerCAmelCase__							)
        a__     : List[Any]  =tokenizer.encode("どういたしまして。"		,				add_special_tokens=lowerCAmelCase__							)

        a__     : Optional[int]  =tokenizer.build_inputs_with_special_tokens(lowerCAmelCase__							)
        a__     : Optional[Any]  =tokenizer.build_inputs_with_special_tokens(lowerCAmelCase__		,				lowerCAmelCase__							)

        # 2 is for "[CLS]", 3 is for "[SEP]"
        assert encoded_sentence == [2] + text + [3]
        assert encoded_pair == [2] + text + [3] + text_a + [3]







@custom_tokenizers
class     __lowerCAmelCase	(   UpperCamelCase__						,    unittest.TestCase):
      _lowercase    : Dict            =      BertJapaneseTokenizer
      _lowercase    : Dict            =      False







      def        _lowercase  (   self							)       ->						str:



        '''simple docstring'''




        super().setUp()

        a__     : Optional[Any]  =["[UNK]", "[CLS]", "[SEP]", "こ", "ん", "に", "ち", "は", "ば", "世", "界", "、", "。"]

        a__     : Union[str, Any]  =os.path.join(self.tmpdirname		,				VOCAB_FILES_NAMES["vocab_file"]							)
        with open(self.vocab_file		,				"w"		,				encoding="utf-8"							) as vocab_writer:
          vocab_writer.write("".join([x + "\n" for x in vocab_tokens]							)							)







      def        _lowercase  (   self		,				**lowerCAmelCase__							)       ->						List[str]:



        '''simple docstring'''




        return BertJapaneseTokenizer.from_pretrained(self.tmpdirname		,				subword_tokenizer_type="character"		,				**lowerCAmelCase__							)







      def        _lowercase  (   self		,				lowerCAmelCase__							)       ->						str:



        '''simple docstring'''




        a__     : Any  ="こんにちは、世界。 \nこんばんは、世界。"
        a__     : Optional[int]  ="こ ん に ち は 、 世 界 。 こ ん ば ん は 、 世 界 。"
        return input_text, output_text







      def        _lowercase  (   self							)       ->						int:



        '''simple docstring'''




        pass  # TODO add if relevant







      def        _lowercase  (   self							)       ->						Tuple:



        '''simple docstring'''




        pass  # TODO add if relevant







      def        _lowercase  (   self							)       ->						Any:



        '''simple docstring'''




        pass  # TODO add if relevant







      def        _lowercase  (   self							)       ->						Tuple:



        '''simple docstring'''




        a__     : Dict  =self.tokenizer_class(self.vocab_file		,				subword_tokenizer_type="character"							)

        a__     : List[str]  =tokenizer.tokenize("こんにちは、世界。 \nこんばんは、世界。"							)
        self.assertListEqual(
            lowerCAmelCase__		,				["こ", "ん", "に", "ち", "は", "、", "世", "界", "。", "こ", "ん", "ば", "ん", "は", "、", "世", "界", "。"]							)
        self.assertListEqual(
            tokenizer.convert_tokens_to_ids(lowerCAmelCase__							)		,				[3, 4, 5, 6, 7, 1_1, 9, 1_0, 1_2, 3, 4, 8, 4, 7, 1_1, 9, 1_0, 1_2]							)







      def        _lowercase  (   self							)       ->						int:



        '''simple docstring'''




        a__     : str  =["[UNK]", "[CLS]", "[SEP]", "こ", "ん", "に", "ち", "は", "ば", "世", "界", "、", "。"]

        a__     : Dict  ={}
        for i, token in enumerate(lowerCAmelCase__							):
          a__     : Optional[int]  =i
        a__     : Union[str, Any]  =CharacterTokenizer(vocab=lowerCAmelCase__		,				unk_token="[UNK]"							)

        self.assertListEqual(tokenizer.tokenize(""							)		,				[]							)

        self.assertListEqual(tokenizer.tokenize("こんにちは"							)		,				["こ", "ん", "に", "ち", "は"]							)

        self.assertListEqual(tokenizer.tokenize("こんにちほ"							)		,				["こ", "ん", "に", "ち", "[UNK]"]							)







      def        _lowercase  (   self							)       ->						Dict:



        '''simple docstring'''




        a__     : Tuple  =self.tokenizer_class.from_pretrained("cl-tohoku/bert-base-japanese-char"							)

        a__     : int  =tokenizer.encode("ありがとう。"		,				add_special_tokens=lowerCAmelCase__							)
        a__     : Any  =tokenizer.encode("どういたしまして。"		,				add_special_tokens=lowerCAmelCase__							)

        a__     : int  =tokenizer.build_inputs_with_special_tokens(lowerCAmelCase__							)
        a__     : Optional[int]  =tokenizer.build_inputs_with_special_tokens(lowerCAmelCase__		,				lowerCAmelCase__							)

        # 2 is for "[CLS]", 3 is for "[SEP]"
        assert encoded_sentence == [2] + text + [3]
        assert encoded_pair == [2] + text + [3] + text_a + [3]







@custom_tokenizers
class     __lowerCAmelCase	(   unittest.TestCase):







      def        _lowercase  (   self							)       ->						Optional[int]:



        '''simple docstring'''




        a__     : Union[str, Any]  ="cl-tohoku/bert-base-japanese"
        a__     : Optional[Any]  =AutoTokenizer.from_pretrained(lowerCAmelCase__							)
        self.assertIsInstance(lowerCAmelCase__		,				lowerCAmelCase__							)







class     __lowerCAmelCase	(   unittest.TestCase):







      def        _lowercase  (   self							)       ->						Tuple:



        '''simple docstring'''




        a__     : List[Any]  ="cl-tohoku/bert-base-japanese"
        with self.assertLogs("transformers"		,				level="WARNING"							) as cm:
          BertTokenizer.from_pretrained(lowerCAmelCase__							)
          self.assertTrue(
              cm.records[0].message.startswith(
                  "The tokenizer class you load from this checkpoint is not the same type as the class this function"
                  " is called from."							)							)
        a__     : int  ="bert-base-cased"
        with self.assertLogs("transformers"		,				level="WARNING"							) as cm:
          BertJapaneseTokenizer.from_pretrained(lowerCAmelCase__							)
          self.assertTrue(
              cm.records[0].message.startswith(
                  "The tokenizer class you load from this checkpoint is not the same type as the class this function"
                  " is called from."							)							)







import random
from typing import Any
def 					_A	(		SCREAMING_SNAKE_CASE					:       list						):





  """simple docstring"""



  for _ in range(len(SCREAMING_SNAKE_CASE						)						):
    a__     : Tuple  =random.randint(0	,	len(SCREAMING_SNAKE_CASE						) - 1						)
    a__     : Any  =random.randint(0	,	len(SCREAMING_SNAKE_CASE						) - 1						)
    a__ ,							a__     : Tuple  =data[b], data[a]
  return data


if __name__ == "__main__":
     UpperCAmelCase     :     Dict							=	[0, 1, 2, 3, 4, 5, 6, 7]
     UpperCAmelCase     :     Optional[Any]							=	["""python""", """says""", """hello""", """!"""]
     print("""Fisher-Yates Shuffle:""")
     print("""List""", integers, strings)
     print("""FY Shuffle""", fisher_yates_shuffle(integers), fisher_yates_shuffle(strings))






