

"""simple docstring"""


import json
import pathlib
import unittest

import numpy as np

from transformers.testing_utils import require_torch, require_vision, slow
from transformers.utils import is_torch_available, is_vision_available

from ...test_image_processing_common import ImageProcessingSavingTestMixin, prepare_image_inputs


if is_torch_available():
			import torch

if is_vision_available():
			from PIL import Image

			from transformers import YolosImageProcessor





class     snake_case	(				unittest.TestCase  ):

				def __init__(	self							:				Union[str, Any]     ,  UpperCamelCase__							:				int     ,  UpperCamelCase__							:				List[str]=7     ,  UpperCamelCase__							:				Optional[Any]=3     ,  UpperCamelCase__							:				List[Any]=3_0     ,  UpperCamelCase__							:				int=4_0_0     ,  UpperCamelCase__							:				Union[str, Any]=True     ,  UpperCamelCase__							:				Dict=None     ,  UpperCamelCase__							:				Optional[Any]=True     ,  UpperCamelCase__							:				Any=[0.5, 0.5, 0.5]     ,  UpperCamelCase__							:				Dict=[0.5, 0.5, 0.5]     ,  UpperCamelCase__							:				int=True     ,  UpperCamelCase__							:				Optional[int]=1 / 2_5_5     ,  UpperCamelCase__							:				List[Any]=True     ,  )->   Optional[Any]:



						'''simple docstring'''


						__lowerCAmelCase:       List[Any]          =			size if size is not None else {"shortest_edge": 1_8, "longest_edge": 1_3_3_3}
						__lowerCAmelCase:       int          =			parent
						__lowerCAmelCase:       Any          =			batch_size
						__lowerCAmelCase:       Tuple          =			num_channels
						__lowerCAmelCase:       int          =			min_resolution
						__lowerCAmelCase:       int          =			max_resolution
						__lowerCAmelCase:       Dict          =			do_resize
						__lowerCAmelCase:       int          =			size
						__lowerCAmelCase:       Dict          =			do_normalize
						__lowerCAmelCase:       int          =			image_mean
						__lowerCAmelCase:       str          =			image_std
						__lowerCAmelCase:       Dict          =			do_rescale
						__lowerCAmelCase:       Optional[int]          =			rescale_factor
						__lowerCAmelCase:       Any          =			do_pad

				def 							lowercase_     (	self							:				Tuple)->   Tuple:



						'''simple docstring'''


						return {
						    "do_resize": self.do_resize,
						    "size": self.size,
						    "do_normalize": self.do_normalize,
						    "image_mean": self.image_mean,
						    "image_std": self.image_std,
						    "do_rescale": self.do_rescale,
						    "rescale_factor": self.rescale_factor,
						    "do_pad": self.do_pad,
						}




				def 							lowercase_     (	self							:				int     ,  UpperCamelCase__							:				Any     ,  UpperCamelCase__							:				str=False)->   Optional[Any]:



						'''simple docstring'''


						if not batched:
								__lowerCAmelCase:       Dict          =			image_inputs[0]
								if isinstance(UpperCamelCase__     ,  Image.Image):
										__lowerCAmelCase      , __lowerCAmelCase:       int          =			image.size
								else:
										__lowerCAmelCase      , __lowerCAmelCase:       Dict          =			image.shape[1], image.shape[2]
								if w < h:
										__lowerCAmelCase:       int          =			int(self.size["shortest_edge"] * h / w)
										__lowerCAmelCase:       Dict          =			self.size["shortest_edge"]
								elif w > h:
										__lowerCAmelCase:       Dict          =			self.size["shortest_edge"]
										__lowerCAmelCase:       str          =			int(self.size["shortest_edge"] * w / h)
								else:
										__lowerCAmelCase:       List[Any]          =			self.size["shortest_edge"]
										__lowerCAmelCase:       Dict          =			self.size["shortest_edge"]

						else:
								__lowerCAmelCase:       str          =			[]
								for image in image_inputs:
										__lowerCAmelCase      , __lowerCAmelCase:       Optional[int]          =			self.get_expected_values([image])
										expected_values.append((expected_height, expected_width))
								__lowerCAmelCase:       Optional[Any]          =			max(UpperCamelCase__     ,  key=lambda UpperCamelCase__: item[0])[0]
								__lowerCAmelCase:       Union[str, Any]          =			max(UpperCamelCase__     ,  key=lambda UpperCamelCase__: item[1])[1]

						return expected_height, expected_width





@require_torch
@require_vision
class     snake_case	(				__snake_case,							unittest.TestCase  ):
				SCREAMING_SNAKE_CASE_   :      Optional[int]         =  YolosImageProcessor if is_vision_available() else None

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



						'''simple docstring'''


						__lowerCAmelCase:       Optional[Any]          =			YolosImageProcessingTester(self)

				@property
				def 							lowercase_     (	self							:				str)->   str:



						'''simple docstring'''


						return self.image_processor_tester.prepare_image_processor_dict()

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



						'''simple docstring'''


						__lowerCAmelCase:       str          =			self.image_processing_class(**self.image_processor_dict)
						self.assertTrue(hasattr(UpperCamelCase__     ,  "image_mean"))
						self.assertTrue(hasattr(UpperCamelCase__     ,  "image_std"))
						self.assertTrue(hasattr(UpperCamelCase__     ,  "do_normalize"))
						self.assertTrue(hasattr(UpperCamelCase__     ,  "do_resize"))
						self.assertTrue(hasattr(UpperCamelCase__     ,  "size"))

				def 							lowercase_     (	self							:				List[Any])->   List[str]:



						'''simple docstring'''


						__lowerCAmelCase:       Optional[int]          =			self.image_processing_class.from_dict(self.image_processor_dict)
						self.assertEqual(image_processor.size     ,  {"shortest_edge": 1_8, "longest_edge": 1_3_3_3})
						self.assertEqual(image_processor.do_pad     ,  UpperCamelCase__)

						__lowerCAmelCase:       Dict          =			self.image_processing_class.from_dict(
						    self.image_processor_dict     ,  size=4_2     ,  max_size=8_4     ,  pad_and_return_pixel_mask=UpperCamelCase__)
						self.assertEqual(image_processor.size     ,  {"shortest_edge": 4_2, "longest_edge": 8_4})
						self.assertEqual(image_processor.do_pad     ,  UpperCamelCase__)

				def 							lowercase_     (	self							:				str)->   Tuple:



						'''simple docstring'''


						pass

				def 							lowercase_     (	self							:				int)->   Any:



						'''simple docstring'''


						__lowerCAmelCase:       int          =			self.image_processing_class(**self.image_processor_dict)
						# create random PIL images
						__lowerCAmelCase:       List[str]          =			prepare_image_inputs(self.image_processor_tester     ,  equal_resolution=UpperCamelCase__)
						for image in image_inputs:
								self.assertIsInstance(UpperCamelCase__     ,  Image.Image)

						# Test not batched input
						__lowerCAmelCase:       List[Any]          =			image_processing(image_inputs[0]     ,  return_tensors="pt").pixel_values

						__lowerCAmelCase      , __lowerCAmelCase:       str          =			self.image_processor_tester.get_expected_values(UpperCamelCase__)

						self.assertEqual(
						    encoded_images.shape     ,  (1, self.image_processor_tester.num_channels, expected_height, expected_width)     ,  )

						# Test batched
						__lowerCAmelCase      , __lowerCAmelCase:       str          =			self.image_processor_tester.get_expected_values(UpperCamelCase__     ,  batched=UpperCamelCase__)

						__lowerCAmelCase:       Optional[Any]          =			image_processing(UpperCamelCase__     ,  return_tensors="pt").pixel_values
						self.assertEqual(
						    encoded_images.shape     ,  (
						        self.image_processor_tester.batch_size,
						        self.image_processor_tester.num_channels,
						        expected_height,
						        expected_width,
						    )     ,  )

				def 							lowercase_     (	self							:				List[str])->   int:



						'''simple docstring'''


						__lowerCAmelCase:       str          =			self.image_processing_class(**self.image_processor_dict)
						# create random numpy tensors
						__lowerCAmelCase:       Tuple          =			prepare_image_inputs(self.image_processor_tester     ,  equal_resolution=UpperCamelCase__     ,  numpify=UpperCamelCase__)
						for image in image_inputs:
								self.assertIsInstance(UpperCamelCase__     ,  np.ndarray)

						# Test not batched input
						__lowerCAmelCase:       Dict          =			image_processing(image_inputs[0]     ,  return_tensors="pt").pixel_values

						__lowerCAmelCase      , __lowerCAmelCase:       int          =			self.image_processor_tester.get_expected_values(UpperCamelCase__)

						self.assertEqual(
						    encoded_images.shape     ,  (1, self.image_processor_tester.num_channels, expected_height, expected_width)     ,  )

						# Test batched
						__lowerCAmelCase:       Tuple          =			image_processing(UpperCamelCase__     ,  return_tensors="pt").pixel_values

						__lowerCAmelCase      , __lowerCAmelCase:       Optional[Any]          =			self.image_processor_tester.get_expected_values(UpperCamelCase__     ,  batched=UpperCamelCase__)

						self.assertEqual(
						    encoded_images.shape     ,  (
						        self.image_processor_tester.batch_size,
						        self.image_processor_tester.num_channels,
						        expected_height,
						        expected_width,
						    )     ,  )

				def 							lowercase_     (	self							:				str)->   Optional[int]:



						'''simple docstring'''


						__lowerCAmelCase:       Any          =			self.image_processing_class(**self.image_processor_dict)
						# create random PyTorch tensors
						__lowerCAmelCase:       int          =			prepare_image_inputs(self.image_processor_tester     ,  equal_resolution=UpperCamelCase__     ,  torchify=UpperCamelCase__)
						for image in image_inputs:
								self.assertIsInstance(UpperCamelCase__     ,  torch.Tensor)

						# Test not batched input
						__lowerCAmelCase:       Optional[int]          =			image_processing(image_inputs[0]     ,  return_tensors="pt").pixel_values

						__lowerCAmelCase      , __lowerCAmelCase:       Union[str, Any]          =			self.image_processor_tester.get_expected_values(UpperCamelCase__)

						self.assertEqual(
						    encoded_images.shape     ,  (1, self.image_processor_tester.num_channels, expected_height, expected_width)     ,  )

						# Test batched
						__lowerCAmelCase:       Tuple          =			image_processing(UpperCamelCase__     ,  return_tensors="pt").pixel_values

						__lowerCAmelCase      , __lowerCAmelCase:       Optional[Any]          =			self.image_processor_tester.get_expected_values(UpperCamelCase__     ,  batched=UpperCamelCase__)

						self.assertEqual(
						    encoded_images.shape     ,  (
						        self.image_processor_tester.batch_size,
						        self.image_processor_tester.num_channels,
						        expected_height,
						        expected_width,
						    )     ,  )

				def 							lowercase_     (	self							:				List[str])->   List[Any]:



						'''simple docstring'''


						__lowerCAmelCase:       str          =			self.image_processing_class(**self.image_processor_dict)
						__lowerCAmelCase:       Dict          =			self.image_processing_class(do_resize=UpperCamelCase__     ,  do_normalize=UpperCamelCase__     ,  do_rescale=UpperCamelCase__)
						# create random PyTorch tensors
						__lowerCAmelCase:       Dict          =			prepare_image_inputs(self.image_processor_tester     ,  equal_resolution=UpperCamelCase__     ,  torchify=UpperCamelCase__)
						for image in image_inputs:
								self.assertIsInstance(UpperCamelCase__     ,  torch.Tensor)

						# Test whether the method "pad" and calling the image processor return the same tensors
						__lowerCAmelCase:       Optional[Any]          =			image_processing_a.pad(UpperCamelCase__     ,  return_tensors="pt")
						__lowerCAmelCase:       Optional[int]          =			image_processing_a(UpperCamelCase__     ,  return_tensors="pt")

						self.assertTrue(
						    torch.allclose(encoded_images_with_method["pixel_values"]     ,  encoded_images["pixel_values"]     ,  atol=1e-4))

				@slow
				def 							lowercase_     (	self							:				List[str])->   int:



						'''simple docstring'''


						__lowerCAmelCase:       Union[str, Any]          =			Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png")
						with open("./tests/fixtures/tests_samples/COCO/coco_annotations.txt"     ,  "r") as f:
								__lowerCAmelCase:       Any          =			json.loads(f.read())

						__lowerCAmelCase:       Any          =			{"image_id": 3_9_7_6_9, "annotations": target}

						# encode them
						__lowerCAmelCase:       Tuple          =			YolosImageProcessor.from_pretrained("hustvl/yolos-small")
						__lowerCAmelCase:       Dict          =			image_processing(images=UpperCamelCase__     ,  annotations=UpperCamelCase__     ,  return_tensors="pt")

						# verify pixel values
						__lowerCAmelCase:       Optional[int]          =			torch.Size([1, 3, 8_0_0, 1_0_6_6])
						self.assertEqual(encoding["pixel_values"].shape     ,  UpperCamelCase__)

						__lowerCAmelCase:       Union[str, Any]          =			torch.tensor([0.2796, 0.3138, 0.3481])
						self.assertTrue(torch.allclose(encoding["pixel_values"][0, 0, 0, :3]     ,  UpperCamelCase__     ,  atol=1e-4))

						# verify area
						__lowerCAmelCase:       List[str]          =			torch.tensor([5887.9600, 11250.2061, 489353.8438, 837122.7500, 147967.5156, 165732.3438])
						self.assertTrue(torch.allclose(encoding["labels"][0]["area"]     ,  UpperCamelCase__))
						# verify boxes
						__lowerCAmelCase:       Optional[int]          =			torch.Size([6, 4])
						self.assertEqual(encoding["labels"][0]["boxes"].shape     ,  UpperCamelCase__)
						__lowerCAmelCase:       Dict          =			torch.tensor([0.5503, 0.2765, 0.0604, 0.2215])
						self.assertTrue(torch.allclose(encoding["labels"][0]["boxes"][0]     ,  UpperCamelCase__     ,  atol=1e-3))
						# verify image_id
						__lowerCAmelCase:       Tuple          =			torch.tensor([3_9_7_6_9])
						self.assertTrue(torch.allclose(encoding["labels"][0]["image_id"]     ,  UpperCamelCase__))
						# verify is_crowd
						__lowerCAmelCase:       Any          =			torch.tensor([0, 0, 0, 0, 0, 0])
						self.assertTrue(torch.allclose(encoding["labels"][0]["iscrowd"]     ,  UpperCamelCase__))
						# verify class_labels
						__lowerCAmelCase:       Tuple          =			torch.tensor([7_5, 7_5, 6_3, 6_5, 1_7, 1_7])
						self.assertTrue(torch.allclose(encoding["labels"][0]["class_labels"]     ,  UpperCamelCase__))
						# verify orig_size
						__lowerCAmelCase:       Optional[Any]          =			torch.tensor([4_8_0, 6_4_0])
						self.assertTrue(torch.allclose(encoding["labels"][0]["orig_size"]     ,  UpperCamelCase__))
						# verify size
						__lowerCAmelCase:       int          =			torch.tensor([8_0_0, 1_0_6_6])
						self.assertTrue(torch.allclose(encoding["labels"][0]["size"]     ,  UpperCamelCase__))




				@slow
				def 							lowercase_     (	self							:				Optional[int])->   List[Any]:



						'''simple docstring'''


						__lowerCAmelCase:       List[str]          =			Image.open("./tests/fixtures/tests_samples/COCO/000000039769.png")
						with open("./tests/fixtures/tests_samples/COCO/coco_panoptic_annotations.txt"     ,  "r") as f:
								__lowerCAmelCase:       Any          =			json.loads(f.read())

						__lowerCAmelCase:       Any          =			{"file_name": "000000039769.png", "image_id": 3_9_7_6_9, "segments_info": target}

						__lowerCAmelCase:       Dict          =			pathlib.Path("./tests/fixtures/tests_samples/COCO/coco_panoptic")

						# encode them
						__lowerCAmelCase:       Dict          =			YolosImageProcessor(format="coco_panoptic")
						__lowerCAmelCase:       List[Any]          =			image_processing(images=UpperCamelCase__     ,  annotations=UpperCamelCase__     ,  masks_path=UpperCamelCase__     ,  return_tensors="pt")

						# verify pixel values
						__lowerCAmelCase:       Tuple          =			torch.Size([1, 3, 8_0_0, 1_0_6_6])
						self.assertEqual(encoding["pixel_values"].shape     ,  UpperCamelCase__)

						__lowerCAmelCase:       Dict          =			torch.tensor([0.2796, 0.3138, 0.3481])
						self.assertTrue(torch.allclose(encoding["pixel_values"][0, 0, 0, :3]     ,  UpperCamelCase__     ,  atol=1e-4))

						# verify area
						__lowerCAmelCase:       List[Any]          =			torch.tensor([147979.6875, 165527.0469, 484638.5938, 11292.9375, 5879.6562, 7634.1147])
						self.assertTrue(torch.allclose(encoding["labels"][0]["area"]     ,  UpperCamelCase__))
						# verify boxes
						__lowerCAmelCase:       int          =			torch.Size([6, 4])
						self.assertEqual(encoding["labels"][0]["boxes"].shape     ,  UpperCamelCase__)
						__lowerCAmelCase:       List[Any]          =			torch.tensor([0.2625, 0.5437, 0.4688, 0.8625])
						self.assertTrue(torch.allclose(encoding["labels"][0]["boxes"][0]     ,  UpperCamelCase__     ,  atol=1e-3))
						# verify image_id
						__lowerCAmelCase:       Any          =			torch.tensor([3_9_7_6_9])
						self.assertTrue(torch.allclose(encoding["labels"][0]["image_id"]     ,  UpperCamelCase__))
						# verify is_crowd
						__lowerCAmelCase:       Tuple          =			torch.tensor([0, 0, 0, 0, 0, 0])
						self.assertTrue(torch.allclose(encoding["labels"][0]["iscrowd"]     ,  UpperCamelCase__))
						# verify class_labels
						__lowerCAmelCase:       List[Any]          =			torch.tensor([1_7, 1_7, 6_3, 7_5, 7_5, 9_3])
						self.assertTrue(torch.allclose(encoding["labels"][0]["class_labels"]     ,  UpperCamelCase__))
						# verify masks
						__lowerCAmelCase:       List[Any]          =			8_2_2_8_7_3
						self.assertEqual(encoding["labels"][0]["masks"].sum().item()     ,  UpperCamelCase__)
						# verify orig_size
						__lowerCAmelCase:       Dict          =			torch.tensor([4_8_0, 6_4_0])
						self.assertTrue(torch.allclose(encoding["labels"][0]["orig_size"]     ,  UpperCamelCase__))
						# verify size
						__lowerCAmelCase:       Union[str, Any]          =			torch.tensor([8_0_0, 1_0_6_6])
						self.assertTrue(torch.allclose(encoding["labels"][0]["size"]     ,  UpperCamelCase__))





"""simple docstring"""


import unittest

from datasets import load_dataset

from transformers import BloomTokenizerFast
from transformers.testing_utils import require_tokenizers

from ...test_tokenization_common import TokenizerTesterMixin





@require_tokenizers
class     snake_case	(				__snake_case,							unittest.TestCase  ):
				SCREAMING_SNAKE_CASE_   :      List[str]         =  None
				SCREAMING_SNAKE_CASE_   :      Tuple         =  BloomTokenizerFast
				SCREAMING_SNAKE_CASE_   :      str         =  BloomTokenizerFast
				SCREAMING_SNAKE_CASE_   :      int         =  True
				SCREAMING_SNAKE_CASE_   :      Tuple         =  False
				SCREAMING_SNAKE_CASE_   :      int         =  """tokenizer_file"""
				SCREAMING_SNAKE_CASE_   :      List[str]         =  {"""bos_token""": """<s>""", """eos_token""": """</s>""", """unk_token""": """<unk>""", """pad_token""": """<pad>"""}

				def 							lowercase_     (	self							:				List[Any])->   Dict:



						'''simple docstring'''


						super().setUp()
						__lowerCAmelCase:       Optional[Any]          =			BloomTokenizerFast.from_pretrained("bigscience/tokenizer")
						tokenizer.save_pretrained(self.tmpdirname)

				def 							lowercase_     (	self							:				List[Any]     ,  **UpperCamelCase__							:				Union[str, Any])->   Optional[Any]:



						'''simple docstring'''


						kwargs.update(self.special_tokens_map)
						return BloomTokenizerFast.from_pretrained(self.tmpdirname     ,  **UpperCamelCase__)

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



						'''simple docstring'''


						__lowerCAmelCase:       str          =			self.get_rust_tokenizer()

						__lowerCAmelCase:       int          =			["The quick brown fox</s>", "jumps over the lazy dog</s>"]
						__lowerCAmelCase:       List[str]          =			[[2_1_7_5, 2_3_7_1_4, 7_3_1_7_3, 1_4_4_2_5_2, 2], [7_7, 1_3_2_6_1_9, 3_4_7_8, 3_6_8, 1_0_9_5_8_6, 3_5_4_3_3, 2]]

						__lowerCAmelCase:       List[str]          =			tokenizer.batch_encode_plus(UpperCamelCase__)["input_ids"]
						self.assertListEqual(UpperCamelCase__     ,  UpperCamelCase__)

						__lowerCAmelCase:       List[Any]          =			tokenizer.batch_decode(UpperCamelCase__)
						self.assertListEqual(UpperCamelCase__     ,  UpperCamelCase__)

				def 							lowercase_     (	self							:				Optional[Any]     ,  UpperCamelCase__							:				Tuple=6)->   Tuple:



						'''simple docstring'''


						for tokenizer, pretrained_name, kwargs in self.tokenizers_list:
								with self.subTest(f"{tokenizer.__class__.__name__} ({pretrained_name})"):
										__lowerCAmelCase:       Optional[Any]          =			self.rust_tokenizer_class.from_pretrained(UpperCamelCase__     ,  **UpperCamelCase__)
										# tokenizer_r.pad_token = None # Hotfixing padding = None
										# Simple input
										__lowerCAmelCase:       Dict          =			"This is a simple input"
										__lowerCAmelCase:       str          =			["This is a simple input 1", "This is a simple input 2"]
										__lowerCAmelCase:       int          =			("This is a simple input", "This is a pair")
										__lowerCAmelCase:       Union[str, Any]          =			[
										    ("This is a simple input 1", "This is a simple input 2"),
										    ("This is a simple pair 1", "This is a simple pair 2"),
										]

										# Simple input tests
										try:
												tokenizer_r.encode(UpperCamelCase__     ,  max_length=UpperCamelCase__)
												tokenizer_r.encode_plus(UpperCamelCase__     ,  max_length=UpperCamelCase__)

												tokenizer_r.batch_encode_plus(UpperCamelCase__     ,  max_length=UpperCamelCase__)
												tokenizer_r.encode(UpperCamelCase__     ,  max_length=UpperCamelCase__)
												tokenizer_r.batch_encode_plus(UpperCamelCase__     ,  max_length=UpperCamelCase__)
										except ValueError:
												self.fail("Bloom Tokenizer should be able to deal with padding")

										__lowerCAmelCase:       Tuple          =			None  # Hotfixing padding = None
										self.assertRaises(UpperCamelCase__     ,  tokenizer_r.encode     ,  UpperCamelCase__     ,  max_length=UpperCamelCase__     ,  padding="max_length")

										# Simple input
										self.assertRaises(UpperCamelCase__     ,  tokenizer_r.encode_plus     ,  UpperCamelCase__     ,  max_length=UpperCamelCase__     ,  padding="max_length")

										# Simple input
										self.assertRaises(
										    UpperCamelCase__     ,  tokenizer_r.batch_encode_plus     ,  UpperCamelCase__     ,  max_length=UpperCamelCase__     ,  padding="max_length"     ,  )

										# Pair input
										self.assertRaises(UpperCamelCase__     ,  tokenizer_r.encode     ,  UpperCamelCase__     ,  max_length=UpperCamelCase__     ,  padding="max_length")

										# Pair input
										self.assertRaises(UpperCamelCase__     ,  tokenizer_r.encode_plus     ,  UpperCamelCase__     ,  max_length=UpperCamelCase__     ,  padding="max_length")

										# Pair input
										self.assertRaises(
										    UpperCamelCase__     ,  tokenizer_r.batch_encode_plus     ,  UpperCamelCase__     ,  max_length=UpperCamelCase__     ,  padding="max_length"     ,  )

				def 							lowercase_     (	self							:				Optional[Any])->   List[str]:



						'''simple docstring'''


						__lowerCAmelCase:       Dict          =			self.get_rust_tokenizer()
						__lowerCAmelCase:       List[str]          =			load_dataset("xnli"     ,  "all_languages"     ,  split="test"     ,  streaming=UpperCamelCase__)

						__lowerCAmelCase:       Union[str, Any]          =			next(iter(UpperCamelCase__))["premise"]  # pick up one data
						__lowerCAmelCase:       Any          =			list(sample_data.values())

						__lowerCAmelCase:       int          =			list(map(tokenizer.encode     ,  UpperCamelCase__))
						__lowerCAmelCase:       str          =			[tokenizer.decode(UpperCamelCase__     ,  clean_up_tokenization_spaces=UpperCamelCase__) for x in output_tokens]
						self.assertListEqual(UpperCamelCase__     ,  UpperCamelCase__)




				def 							lowercase_     (	self							:				Optional[int])->   str:



						'''simple docstring'''


						self.assertGreaterEqual(len(self.tokenizer_class.pretrained_vocab_files_map)     ,  1)
						self.assertGreaterEqual(len(list(self.tokenizer_class.pretrained_vocab_files_map.values())[0])     ,  1)


