





import bza
import gzip
import lzma
import os
import shutil
import struct
import tarfile
import warnings
import zipfile
from abc import ABC, abstractmethod
from pathlib import Path
from typing import Dict, List, Optional, Type, Union

from .. import config
from .filelock import FileLock
from .logging import get_logger


lowerCAmelCase_    =    get_logger(__name__)



class  __lowerCAmelCase	:






			def __init__(self ,							__magic_name__ = None   )					->       Optional[Any]:


							'''simple docstring'''



							snake_case_						:   Tuple           =  (
							    os.path.join(__magic_name__ ,							config.EXTRACTED_DATASETS_DIR   ) if cache_dir else config.EXTRACTED_DATASETS_PATH
							)
							snake_case_						:   Any           =  Extractor






			def       lowerCamelCase  (self ,							__magic_name__   )					->       str:


							'''simple docstring'''



							from .file_utils import hash_url_to_filename

							# Path where we extract compressed archives
							# We extract in the cache dir, and get the extracted path name by hashing the original path"
							snake_case_						:   Tuple           =  os.path.abspath(__magic_name__   )
							return os.path.join(self.extract_dir ,							hash_url_to_filename(__magic_name__   )   )






			def       lowerCamelCase  (self ,							__magic_name__ ,							__magic_name__   )					->       bool:


							'''simple docstring'''



							return force_extract or (
							    not os.path.isfile(__magic_name__   ) and not (os.path.isdir(__magic_name__   ) and os.listdir(__magic_name__   ))
							)






			def       lowerCamelCase  (self ,							__magic_name__ ,							__magic_name__ = False   )					->       str:


							'''simple docstring'''



							snake_case_						:   Union[str, Any]           =  self.extractor.infer_extractor_format(__magic_name__   )
							if not extractor_format:
											return input_path
							snake_case_						:   int           =  self._get_output_path(__magic_name__   )
							if self._do_extract(__magic_name__ ,							__magic_name__   ):
											self.extractor.extract(__magic_name__ ,							__magic_name__ ,							__magic_name__   )
							return output_path




class  __lowerCAmelCase	(      _a					):






			@classmethod
			@abstractmethod
			def       lowerCamelCase  (cls ,							__magic_name__ ,							**__magic_name__   )					->       bool:


							'''simple docstring'''



							...






			@staticmethod
			@abstractmethod
			def       lowerCamelCase  (__magic_name__ ,							__magic_name__   )					->       None:


							'''simple docstring'''



							...




class  __lowerCAmelCase	(      _a,					_a					):
			lowerCamelCase_					:					List[bytes]	      =				[]






			@staticmethod
			def       lowerCamelCase  (__magic_name__ ,							__magic_name__   )					->       int:


							'''simple docstring'''



							with open(__magic_name__ ,							'''rb'''   ) as f:
											return f.read(__magic_name__   )






			@classmethod
			def       lowerCamelCase  (cls ,							__magic_name__ ,							__magic_name__ = b""   )					->       bool:


							'''simple docstring'''



							if not magic_number:
											snake_case_						:   Any           =  max(len(__magic_name__   ) for cls_magic_number in cls.magic_numbers   )
											try:
															snake_case_						:   int           =  cls.read_magic_number(__magic_name__ ,							__magic_name__   )
											except OSError:
															return False
							return any(magic_number.startswith(__magic_name__   ) for cls_magic_number in cls.magic_numbers   )




class  __lowerCAmelCase	(      _a					):






			@classmethod
			def       lowerCamelCase  (cls ,							__magic_name__ ,							**__magic_name__   )					->       bool:


							'''simple docstring'''



							return tarfile.is_tarfile(__magic_name__   )






			@staticmethod
			def       lowerCamelCase  (__magic_name__ ,							__magic_name__   )					->       Union[str, Any]:


							'''simple docstring'''



							def resolved(__magic_name__   ) -> str:
											return os.path.realpath(os.path.abspath(__magic_name__   )   )

							def badpath(__magic_name__ ,							__magic_name__   ) -> bool:
											# joinpath will ignore base if path is absolute
											return not resolved(os.path.join(__magic_name__ ,							__magic_name__   )   ).startswith(__magic_name__   )

							def badlink(__magic_name__ ,							__magic_name__   ) -> bool:
											# Links are interpreted relative to the directory containing the link
											snake_case_						:   Union[str, Any]           =  resolved(os.path.join(__magic_name__ ,							os.path.dirname(info.name   )   )   )
											return badpath(info.linkname ,							base=__magic_name__   )

							snake_case_						:   Tuple           =  resolved(__magic_name__   )

							for finfo in members:
											if badpath(finfo.name ,							__magic_name__   ):
															logger.error(F'''Extraction of {finfo.name} is blocked (illegal path)'''   )
											elif finfo.issym() and badlink(__magic_name__ ,							__magic_name__   ):
															logger.error(F'''Extraction of {finfo.name} is blocked: Symlink to {finfo.linkname}'''   )
											elif finfo.islnk() and badlink(__magic_name__ ,							__magic_name__   ):
															logger.error(F'''Extraction of {finfo.name} is blocked: Hard link to {finfo.linkname}'''   )
											else:
															yield finfo






			@staticmethod
			def       lowerCamelCase  (__magic_name__ ,							__magic_name__   )					->       None:


							'''simple docstring'''



							os.makedirs(__magic_name__ ,							exist_ok=__magic_name__   )
							snake_case_						:   str           =  tarfile.open(__magic_name__   )
							tar_file.extractall(__magic_name__ ,							members=TarExtractor.safemembers(__magic_name__ ,							__magic_name__   )   )
							tar_file.close()




class  __lowerCAmelCase	(      _a					):
			lowerCamelCase_					:					List[Any]	      =				[B'''\x1F\x8B''']






			@staticmethod
			def       lowerCamelCase  (__magic_name__ ,							__magic_name__   )					->       None:


							'''simple docstring'''



							with gzip.open(__magic_name__ ,							'''rb'''   ) as gzip_file:
											with open(__magic_name__ ,							'''wb'''   ) as extracted_file:
															shutil.copyfileobj(__magic_name__ ,							__magic_name__   )




class  __lowerCAmelCase	(      _a					):
			lowerCamelCase_					:					Tuple	      =				[
			    B'''PK\x03\x04''',
			    B'''PK\x05\x06''',  # empty archive
			    B'''PK\x07\x08''',  # spanned archive
			]






			@classmethod
			def       lowerCamelCase  (cls ,							__magic_name__ ,							__magic_name__ = b""   )					->       bool:


							'''simple docstring'''



							if super().is_extractable(__magic_name__ ,							magic_number=__magic_name__   ):
											return True
							try:
											# Alternative version of zipfile.is_zipfile that has less false positives, but misses executable zip archives.
											# From: https://github.com/python/cpython/pull/5053
											from zipfile import (
											    _CD_SIGNATURE,
											    _ECD_DISK_NUMBER,
											    _ECD_DISK_START,
											    _ECD_ENTRIES_TOTAL,
											    _ECD_OFFSET,
											    _ECD_SIZE,
											    _EndRecData,
											    sizeCentralDir,
											    stringCentralDir,
											    structCentralDir,
											)

											with open(__magic_name__ ,							'''rb'''   ) as fp:
															snake_case_						:   List[Any]           =  _EndRecData(__magic_name__   )
															if endrec:
																			if endrec[_ECD_ENTRIES_TOTAL] == 0 and endrec[_ECD_SIZE] == 0 and endrec[_ECD_OFFSET] == 0:
																							return True  # Empty zipfiles are still zipfiles
																			elif endrec[_ECD_DISK_NUMBER] == endrec[_ECD_DISK_START]:
																							fp.seek(endrec[_ECD_OFFSET]   )  # Central directory is on the same disk
																							if fp.tell() == endrec[_ECD_OFFSET] and endrec[_ECD_SIZE] >= sizeCentralDir:
																											snake_case_						:   Optional[Any]           =  fp.read(__magic_name__   )  # CD is where we expect it to be
																											if len(__magic_name__   ) == sizeCentralDir:
																															snake_case_						:   Dict           =  struct.unpack(__magic_name__ ,							__magic_name__   )  # CD is the right size
																															if centdir[_CD_SIGNATURE] == stringCentralDir:
																																			return True  # First central directory entry  has correct magic number
											return False
							except Exception:  # catch all errors in case future python versions change the zipfile internals
											return False






			@staticmethod
			def       lowerCamelCase  (__magic_name__ ,							__magic_name__   )					->       None:


							'''simple docstring'''



							os.makedirs(__magic_name__ ,							exist_ok=__magic_name__   )
							with zipfile.ZipFile(__magic_name__ ,							'''r'''   ) as zip_file:
											zip_file.extractall(__magic_name__   )
											zip_file.close()




class  __lowerCAmelCase	(      _a					):
			lowerCamelCase_					:					Dict	      =				[B'''\xFD\x37\x7A\x58\x5A\x00''']






			@staticmethod
			def       lowerCamelCase  (__magic_name__ ,							__magic_name__   )					->       None:


							'''simple docstring'''



							with lzma.open(__magic_name__   ) as compressed_file:
											with open(__magic_name__ ,							'''wb'''   ) as extracted_file:
															shutil.copyfileobj(__magic_name__ ,							__magic_name__   )




class  __lowerCAmelCase	(      _a					):
			lowerCamelCase_					:					int	      =				[B'''Rar!\x1a\x07\x00''', B'''Rar!\x1a\x07\x01\x00''']  # RAR_ID  # RAR5_ID






			@staticmethod
			def       lowerCamelCase  (__magic_name__ ,							__magic_name__   )					->       None:


							'''simple docstring'''



							if not config.RARFILE_AVAILABLE:
											raise ImportError('''Please pip install rarfile'''   )
							import rarfile

							os.makedirs(__magic_name__ ,							exist_ok=__magic_name__   )
							snake_case_						:   Union[str, Any]           =  rarfile.RarFile(__magic_name__   )
							rf.extractall(__magic_name__   )
							rf.close()




class  __lowerCAmelCase	(      _a					):
			lowerCamelCase_					:					int	      =				[B'''\x28\xb5\x2F\xFD''']






			@staticmethod
			def       lowerCamelCase  (__magic_name__ ,							__magic_name__   )					->       None:


							'''simple docstring'''



							if not config.ZSTANDARD_AVAILABLE:
											raise ImportError('''Please pip install zstandard'''   )
							import zstandard as zstd

							snake_case_						:   List[Any]           =  zstd.ZstdDecompressor()
							with open(__magic_name__ ,							'''rb'''   ) as ifh, open(__magic_name__ ,							'''wb'''   ) as ofh:
											dctx.copy_stream(__magic_name__ ,							__magic_name__   )




class  __lowerCAmelCase	(      _a					):
			lowerCamelCase_					:					Dict	      =				[B'''\x42\x5A\x68''']






			@staticmethod
			def       lowerCamelCase  (__magic_name__ ,							__magic_name__   )					->       None:


							'''simple docstring'''



							with bza.open(__magic_name__ ,							'''rb'''   ) as compressed_file:
											with open(__magic_name__ ,							'''wb'''   ) as extracted_file:
															shutil.copyfileobj(__magic_name__ ,							__magic_name__   )




class  __lowerCAmelCase	(      _a					):
			lowerCamelCase_					:					Any	      =				[B'''\x37\x7A\xBC\xAF\x27\x1C''']






			@staticmethod
			def       lowerCamelCase  (__magic_name__ ,							__magic_name__   )					->       None:


							'''simple docstring'''



							if not config.PY7ZR_AVAILABLE:
											raise ImportError('''Please pip install py7zr'''   )
							import pyazr

							os.makedirs(__magic_name__ ,							exist_ok=__magic_name__   )
							with pyazr.SevenZipFile(__magic_name__ ,							'''r'''   ) as archive:
											archive.extractall(__magic_name__   )




class  __lowerCAmelCase	(      _a					):
			lowerCamelCase_					:					List[Any]	      =				[B'''\x04\x22\x4D\x18''']






			@staticmethod
			def       lowerCamelCase  (__magic_name__ ,							__magic_name__   )					->       None:


							'''simple docstring'''



							if not config.LZ4_AVAILABLE:
											raise ImportError('''Please pip install lz4'''   )
							import lza.frame

							with lza.frame.open(__magic_name__ ,							'''rb'''   ) as compressed_file:
											with open(__magic_name__ ,							'''wb'''   ) as extracted_file:
															shutil.copyfileobj(__magic_name__ ,							__magic_name__   )




class  __lowerCAmelCase	:
			#  Put zip file to the last, b/c it is possible wrongly detected as zip (I guess it means: as tar or gzip)
			lowerCamelCase_					:					Dict[str, Type[BaseExtractor]]	      =				{
			    "tar": TarExtractor,
			    "gzip": GzipExtractor,
			    "zip": ZipExtractor,
			    "xz": XzExtractor,
			    "rar": RarExtractor,
			    "zstd": ZstdExtractor,
			    "bz2": BzipaExtractor,
			    "7z": SevenZipExtractor,  # <Added version="2.4.0"/>
			    "lz4": LzaExtractor,  # <Added version="2.4.0"/>
			}






			@classmethod
			def       lowerCamelCase  (cls   )					->       List[Any]:


							'''simple docstring'''



							return max(
							    len(__magic_name__   )
							    for extractor in cls.extractors.values()
							    if issubclass(__magic_name__ ,							__magic_name__   )
							    for extractor_magic_number in extractor.magic_numbers   )






			@staticmethod
			def       lowerCamelCase  (__magic_name__ ,							__magic_name__   )					->       List[str]:


							'''simple docstring'''



							try:
											return MagicNumberBaseExtractor.read_magic_number(__magic_name__ ,							magic_number_length=__magic_name__   )
							except OSError:
											return b""






			@classmethod
			def       lowerCamelCase  (cls ,							__magic_name__ ,							__magic_name__ = False   )					->       bool:


							'''simple docstring'''



							warnings.warn(
							    '''Method \'is_extractable\' was deprecated in version 2.4.0 and will be removed in 3.0.0. '''
							    '''Use \'infer_extractor_format\' instead.''' ,							category=__magic_name__ ,							)
							snake_case_						:   int           =  cls.infer_extractor_format(__magic_name__   )
							if extractor_format:
											return True if not return_extractor else (True, cls.extractors[extractor_format])
							return False if not return_extractor else (False, None)






			@classmethod
			def       lowerCamelCase  (cls ,							__magic_name__   )					->       str:  # <Added version="2.4.0"/>


							'''simple docstring'''



							snake_case_						:   List[Any]           =  cls._get_magic_number_max_length()
							snake_case_						:   Optional[Any]           =  cls._read_magic_number(__magic_name__ ,							__magic_name__   )
							for extractor_format, extractor in cls.extractors.items():
											if extractor.is_extractable(__magic_name__ ,							magic_number=__magic_name__   ):
															return extractor_format






			@classmethod
			def       lowerCamelCase  (cls ,							__magic_name__ ,							__magic_name__ ,							__magic_name__ = None ,							__magic_name__ = "deprecated" ,							)					->       None:


							'''simple docstring'''



							os.makedirs(os.path.dirname(__magic_name__   ) ,							exist_ok=__magic_name__   )
							# Prevent parallel extractions
							snake_case_						:   Tuple           =  str(Path(__magic_name__   ).with_suffix('''.lock'''   )   )
							with FileLock(__magic_name__   ):
											shutil.rmtree(__magic_name__ ,							ignore_errors=__magic_name__   )
											if extractor_format or extractor != "deprecated":
															if extractor != "deprecated" or not isinstance(__magic_name__ ,							__magic_name__   ):  # passed as positional arg
																			warnings.warn(
																			    '''Parameter \'extractor\' was deprecated in version 2.4.0 and will be removed in 3.0.0. '''
																			    '''Use \'extractor_format\' instead.''' ,							category=__magic_name__ ,							)
																			snake_case_						:   Tuple           =  extractor if extractor != '''deprecated''' else extractor_format
															else:
																			snake_case_						:   List[str]           =  cls.extractors[extractor_format]
															return extractor.extract(__magic_name__ ,							__magic_name__   )
											else:
															warnings.warn(
															    '''Parameter \'extractor_format\' was made required in version 2.4.0 and not passing it will raise an '''
															    '''exception in 3.0.0.''' ,							category=__magic_name__ ,							)
															for extractor in cls.extractors.values():
																			if extractor.is_extractable(__magic_name__   ):
																							return extractor.extract(__magic_name__ ,							__magic_name__   )







import unittest

from transformers import GPTSwaTokenizer
from transformers.testing_utils import get_tests_dir, require_sentencepiece, require_tokenizers, slow

from ...test_tokenization_common import TokenizerTesterMixin


lowerCAmelCase_    =    get_tests_dir('''fixtures/test_sentencepiece_with_bytefallback.model''')



@require_sentencepiece
@require_tokenizers
class  __lowerCAmelCase	(      _a,					unittest.TestCase					):
			lowerCamelCase_					:					List[str]	      =				GPTSwaTokenizer
			lowerCamelCase_					:					str	      =				False
			lowerCamelCase_					:					str	      =				True
			lowerCamelCase_					:					List[Any]	      =				False






			def       lowerCamelCase  (self   )					->       List[str]:


							'''simple docstring'''



							super().setUp()

							# We have a SentencePiece fixture for testing
							snake_case_						:   Union[str, Any]           =  GPTSwaTokenizer(__magic_name__ ,							eos_token='''<unk>''' ,							bos_token='''<unk>''' ,							pad_token='''<unk>'''   )

							tokenizer.save_pretrained(self.tmpdirname   )






			def       lowerCamelCase  (self ,							__magic_name__   )					->       int:


							'''simple docstring'''



							snake_case_						:   Any           =  '''This is a test'''
							snake_case_						:   str           =  '''This is a test'''
							return input_text, output_text






			def       lowerCamelCase  (self   )					->       Any:


							'''simple docstring'''



							snake_case_						:   int           =  '''<s>'''
							snake_case_						:   Any           =  1

							self.assertEqual(self.get_tokenizer()._convert_token_to_id(__magic_name__   ) ,							__magic_name__   )
							self.assertEqual(self.get_tokenizer()._convert_id_to_token(__magic_name__   ) ,							__magic_name__   )






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


							'''simple docstring'''



							snake_case_						:   Union[str, Any]           =  list(self.get_tokenizer().get_vocab().keys()   )

							self.assertEqual(vocab_keys[0] ,							'''<unk>'''   )
							self.assertEqual(vocab_keys[1] ,							'''<s>'''   )
							self.assertEqual(vocab_keys[-1] ,							'''j'''   )
							self.assertEqual(len(__magic_name__   ) ,							2000   )






			def       lowerCamelCase  (self   )					->       List[str]:


							'''simple docstring'''



							self.assertEqual(self.get_tokenizer().vocab_size ,							2000   )






			def       lowerCamelCase  (self   )					->       List[str]:


							'''simple docstring'''



							snake_case_						:   str           =  GPTSwaTokenizer(__magic_name__   )

							snake_case_						:   List[str]           =  tokenizer.tokenize('''This is a test'''   )
							self.assertListEqual(__magic_name__ ,							['''▁This''', '''▁is''', '''▁a''', '''▁t''', '''est''']   )

							self.assertListEqual(tokenizer.convert_tokens_to_ids(__magic_name__   ) ,							[465, 287, 265, 631, 842]   )

							snake_case_						:   Optional[int]           =  tokenizer.tokenize('''I was born in 92000, and this is falsé.'''   )
							# fmt: off
							self.assertListEqual(
							    __magic_name__ ,							['''▁I''', '''▁was''', '''▁bor''', '''n''', '''▁in''', '''▁''', '''<0x39>''', '''2''', '''0''', '''0''', '''0''', ''',''', '''▁and''', '''▁this''', '''▁is''', '''▁f''', '''al''', '''s''', '''<0xC3>''', '''<0xA9>''', '''.'''] ,							)
							# fmt: on

							snake_case_						:   int           =  tokenizer.convert_tokens_to_ids(__magic_name__   )
							self.assertListEqual(
							    __magic_name__ ,							[262, 272, 1525, 286, 271, 268, 60, 916, 633, 633, 633, 259, 266, 301, 287, 384, 367, 263, 198, 172, 260] ,							)

							snake_case_						:   Dict           =  tokenizer.convert_ids_to_tokens(__magic_name__   )
							# fmt: off
							self.assertListEqual(
							    __magic_name__ ,							['''▁I''', '''▁was''', '''▁bor''', '''n''', '''▁in''', '''▁''', '''<0x39>''', '''2''', '''0''', '''0''', '''0''', ''',''', '''▁and''', '''▁this''', '''▁is''', '''▁f''', '''al''', '''s''', '''<0xC3>''', '''<0xA9>''', '''.''']   )
							# fmt: on






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


							'''simple docstring'''



							snake_case_						:   Optional[Any]           =  GPTSwaTokenizer(__magic_name__   )
							snake_case_						:   Tuple           =  ['''This is a test''', '''I was born in 92000, and this is falsé.''']
							snake_case_						:   Optional[int]           =  [
							    [465, 287, 265, 631, 842],
							    [262, 272, 1525, 286, 271, 268, 60, 916, 633, 633, 633, 259, 266, 301, 287, 384, 367, 263, 198, 172, 260],
							]

							# Test that encode_fast returns the same as tokenize + convert_tokens_to_ids
							for text, expected_ids in zip(__magic_name__ ,							__magic_name__   ):
											self.assertListEqual(tokenizer.encode_fast(__magic_name__   ) ,							__magic_name__   )

							# Test that decode_fast returns the input text
							for text, token_ids in zip(__magic_name__ ,							__magic_name__   ):
											self.assertEqual(tokenizer.decode_fast(__magic_name__   ) ,							__magic_name__   )






			@slow
			def       lowerCamelCase  (self   )					->       Tuple:


							'''simple docstring'''



							snake_case_						:   str           =  [
							    '''<|python|>def fibonacci(n)\n    if n < 0:\n        print(\'Incorrect input\')''',
							    '''Hey there, how are you doing this fine day?''',
							    '''This is a text with a trailing spaces followed by a dot     .''',
							    '''Häj sväjs lillebrör! =)''',
							    '''Det är inget fel på Mr. Cool''',
							]

							# fmt: off
							snake_case_						:   str           =  {'''input_ids''': [[6_3423, 5, 6811, 1_4954, 282, 816, 3821, 6_3466, 6_3425, 6_3462, 18, 6_3978, 678, 301, 1320, 6_3423, 6_3455, 6_3458, 18, 6_3982, 4246, 3940, 1901, 4_7789, 5547, 1_8994], [1_9630, 1100, 6_3446, 1342, 633, 544, 4488, 593, 5102, 2416, 6_3495, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1652, 428, 268, 1936, 515, 268, 5_8593, 2_2413, 9106, 546, 268, 3_3213, 6_3979, 698, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [5_5130, 6_3450, 924, 6_3449, 2249, 4062, 1558, 318, 6_3504, 2_1498, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [509, 377, 2827, 2559, 332, 6575, 6_3443, 2_6801, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], '''token_type_ids''': [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]], '''attention_mask''': [[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]}
							# fmt: on
							self.tokenizer_integration_test_util(
							    expected_encoding=__magic_name__ ,							model_name='''AI-Sweden/gpt-sw3-126m''' ,							sequences=__magic_name__ ,							)
