






import inspect
import unittest
import warnings
from math import ceil, floor

from transformers import LevitConfig
from transformers.file_utils import cached_property, is_torch_available, is_vision_available
from transformers.models.auto import get_values
from transformers.testing_utils import require_torch, require_vision, slow, torch_device

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
		import torch

		from transformers import (
		    MODEL_FOR_IMAGE_CLASSIFICATION_MAPPING,
		    MODEL_MAPPING,
		    LevitForImageClassification,
		    LevitForImageClassificationWithTeacher,
		    LevitModel,
		)
		from transformers.models.levit.modeling_levit import LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
		from PIL import Image

		from transformers import LevitImageProcessor





class 	SCREAMING_SNAKE_CASE					(					lowercase__       ):






			def 			SCREAMING_SNAKE_CASE      ( self      :			str					)			->			Any:
							a_		:  List[Any]											=      self.config_class(**self.inputs_dict					)
							self.parent.assertTrue(hasattr(__lowercase  ,						'''hidden_sizes'''					)					)
							self.parent.assertTrue(hasattr(__lowercase  ,						'''num_attention_heads'''					)					)





class 	SCREAMING_SNAKE_CASE					:






			def __init__( self      :			Any  ,						__SCREAMING_SNAKE_CASE      :			List[str]  ,						__SCREAMING_SNAKE_CASE      :			Dict=13  ,						__SCREAMING_SNAKE_CASE      :			str=64  ,						__SCREAMING_SNAKE_CASE      :			str=3  ,						__SCREAMING_SNAKE_CASE      :			Any=3  ,						__SCREAMING_SNAKE_CASE      :			Tuple=2  ,						__SCREAMING_SNAKE_CASE      :			List[str]=1  ,						__SCREAMING_SNAKE_CASE      :			int=16  ,						__SCREAMING_SNAKE_CASE      :			Optional[int]=[128, 256, 384]  ,						__SCREAMING_SNAKE_CASE      :			List[Any]=[4, 6, 8]  ,						__SCREAMING_SNAKE_CASE      :			str=[2, 3, 4]  ,						__SCREAMING_SNAKE_CASE      :			List[Any]=[16, 16, 16]  ,						__SCREAMING_SNAKE_CASE      :			int=0  ,						__SCREAMING_SNAKE_CASE      :			str=[2, 2, 2]  ,						__SCREAMING_SNAKE_CASE      :			Tuple=[2, 2, 2]  ,						__SCREAMING_SNAKE_CASE      :			Dict=0.02  ,						__SCREAMING_SNAKE_CASE      :			Optional[Any]=True  ,						__SCREAMING_SNAKE_CASE      :			Any=True  ,						__SCREAMING_SNAKE_CASE      :			List[str]=2  ,						)			->			Tuple:
							a_		:  List[Any]											=      parent
							a_		:  Tuple											=      batch_size
							a_		:  Tuple											=      image_size
							a_		:  List[Any]											=      num_channels
							a_		:  Any											=      kernel_size
							a_		:  List[Any]											=      stride
							a_		:  Optional[int]											=      padding
							a_		:  Optional[int]											=      hidden_sizes
							a_		:  Any											=      num_attention_heads
							a_		:  int											=      depths
							a_		:  List[Any]											=      key_dim
							a_		:  Optional[int]											=      drop_path_rate
							a_		:  Tuple											=      patch_size
							a_		:  Union[str, Any]											=      attention_ratio
							a_		:  List[str]											=      mlp_ratio
							a_		:  str											=      initializer_range
							a_		:  Dict											=      [
							    ['''Subsample''', key_dim[0], hidden_sizes[0] // key_dim[0], 4, 2, 2],
							    ['''Subsample''', key_dim[0], hidden_sizes[1] // key_dim[0], 4, 2, 2],
							]
							a_		:  Optional[int]											=      is_training
							a_		:  Tuple											=      use_labels
							a_		:  Optional[int]											=      num_labels
							a_		:  str											=      initializer_range






			def 			SCREAMING_SNAKE_CASE      ( self      :			Dict					)			->			List[str]:
							a_		:  Tuple											=      floats_tensor([self.batch_size, self.num_channels, self.image_size, self.image_size]					)

							a_		:  Union[str, Any]											=      None
							if self.use_labels:
											a_		:  int											=      ids_tensor([self.batch_size]  ,						self.num_labels					)

							a_		:  Any											=      self.get_config()
							return config, pixel_values, labels






			def 			SCREAMING_SNAKE_CASE      ( self      :			Tuple					)			->			Optional[int]:
							return LevitConfig(
							    image_size=self.image_size  ,						num_channels=self.num_channels  ,						kernel_size=self.kernel_size  ,						stride=self.stride  ,						padding=self.padding  ,						patch_size=self.patch_size  ,						hidden_sizes=self.hidden_sizes  ,						num_attention_heads=self.num_attention_heads  ,						depths=self.depths  ,						key_dim=self.key_dim  ,						drop_path_rate=self.drop_path_rate  ,						mlp_ratio=self.mlp_ratio  ,						attention_ratio=self.attention_ratio  ,						initializer_range=self.initializer_range  ,						down_ops=self.down_ops  ,						)






			def 			SCREAMING_SNAKE_CASE      ( self      :			Dict  ,						__SCREAMING_SNAKE_CASE      :			Optional[int]  ,						__SCREAMING_SNAKE_CASE      :			Any  ,						__SCREAMING_SNAKE_CASE      :			str					)			->			List[str]:
							a_		:  List[Any]											=      LevitModel(config=__lowercase					)
							model.to(__lowercase					)
							model.eval()
							a_		:  Optional[Any]											=      model(__lowercase					)
							a_		:  Optional[Any]											=      (self.image_size, self.image_size)
							a_				,			a_		:  Union[str, Any]											=      image_size[0], image_size[1]
							for _ in range(4					):
											a_		:  str											=      floor(((height + 2 * self.padding - self.kernel_size) / self.stride) + 1					)
											a_		:  Any											=      floor(((width + 2 * self.padding - self.kernel_size) / self.stride) + 1					)
							self.parent.assertEqual(
							    result.last_hidden_state.shape  ,						(self.batch_size, ceil(height / 4					) * ceil(width / 4					), self.hidden_sizes[-1])  ,						)






			def 			SCREAMING_SNAKE_CASE      ( self      :			List[Any]  ,						__SCREAMING_SNAKE_CASE      :			int  ,						__SCREAMING_SNAKE_CASE      :			List[str]  ,						__SCREAMING_SNAKE_CASE      :			List[str]					)			->			List[str]:
							a_		:  Union[str, Any]											=      self.num_labels
							a_		:  Optional[int]											=      LevitForImageClassification(__lowercase					)
							model.to(__lowercase					)
							model.eval()
							a_		:  List[Any]											=      model(__lowercase  ,						labels=__lowercase					)
							self.parent.assertEqual(result.logits.shape  ,						(self.batch_size, self.num_labels)					)







			def 			SCREAMING_SNAKE_CASE      ( self      :			str					)			->			Optional[int]:
							a_		:  str											=      self.prepare_config_and_inputs()
							a_				,			a_				,			a_		:  Dict											=      config_and_inputs
							a_		:  Any											=      {'''pixel_values''': pixel_values}
							return config, inputs_dict





@require_torch
class 	SCREAMING_SNAKE_CASE					(					lowercase__	,   lowercase__	,   unittest.TestCase       ):
			snake_case__  =				(
			    (LevitModel, LevitForImageClassification, LevitForImageClassificationWithTeacher)
			    if is_torch_available()
			    else ()
			)
			snake_case__  =				(
			    {
			        """feature-extraction""": LevitModel,
			        """image-classification""": (LevitForImageClassification, LevitForImageClassificationWithTeacher),
			    }
			    if is_torch_available()
			    else {}
			)

			snake_case__  =				False
			snake_case__  =				False
			snake_case__  =				False
			snake_case__  =				False
			snake_case__  =				False






			def 			SCREAMING_SNAKE_CASE      ( self      :			Union[str, Any]					)			->			str:
							a_		:  Tuple											=      LevitModelTester(self					)
							a_		:  List[Any]											=      ConfigTester(self  ,						config_class=__lowercase  ,						has_text_modality=__lowercase  ,						hidden_size=37					)






			def 			SCREAMING_SNAKE_CASE      ( self      :			Optional[int]					)			->			int:
							self.create_and_test_config_common_properties()
							self.config_tester.create_and_test_config_to_json_string()
							self.config_tester.create_and_test_config_to_json_file()
							self.config_tester.create_and_test_config_from_and_save_pretrained()
							self.config_tester.create_and_test_config_with_num_labels()
							self.config_tester.check_config_can_be_init_without_params()
							self.config_tester.check_config_arguments_init()






			def 			SCREAMING_SNAKE_CASE      ( self      :			int					)			->			List[Any]:
							return






			@unittest.skip(reason='''Levit does not use inputs_embeds'''					)
			def 			SCREAMING_SNAKE_CASE      ( self      :			Tuple					)			->			Optional[int]:
							pass






			@unittest.skip(reason='''Levit does not support input and output embeddings'''					)
			def 			SCREAMING_SNAKE_CASE      ( self      :			Any					)			->			str:
							pass






			@unittest.skip(reason='''Levit does not output attentions'''					)
			def 			SCREAMING_SNAKE_CASE      ( self      :			Tuple					)			->			Union[str, Any]:
							pass






			def 			SCREAMING_SNAKE_CASE      ( self      :			Optional[Any]					)			->			Union[str, Any]:
							a_				,			a_		:  List[Any]											=      self.model_tester.prepare_config_and_inputs_for_common()

							for model_class in self.all_model_classes:
											a_		:  Optional[int]											=      model_class(__lowercase					)
											a_		:  Tuple											=      inspect.signature(model.forward					)
											# signature.parameters is an OrderedDict => so arg_names order is deterministic
											a_		:  Any											=      [*signature.parameters.keys()]

											a_		:  Dict											=      ['''pixel_values''']
											self.assertListEqual(arg_names[:1]  ,						__lowercase					)






			def 			SCREAMING_SNAKE_CASE      ( self      :			int					)			->			List[Any]:
							def check_hidden_states_output(__SCREAMING_SNAKE_CASE      :			str  ,						__SCREAMING_SNAKE_CASE      :			Tuple  ,						__SCREAMING_SNAKE_CASE      :			List[Any]					):
											a_		:  str											=      model_class(__lowercase					)
											model.to(__lowercase					)
											model.eval()

											with torch.no_grad():
															a_		:  List[Any]											=      model(**self._prepare_for_class(__lowercase  ,						__lowercase					)					)

											a_		:  List[Any]											=      outputs.hidden_states

											a_		:  Optional[int]											=      len(self.model_tester.depths					) + 1
											self.assertEqual(len(__lowercase					)  ,						__lowercase					)

											a_		:  Union[str, Any]											=      (self.model_tester.image_size, self.model_tester.image_size)
											a_				,			a_		:  Union[str, Any]											=      image_size[0], image_size[1]
											for _ in range(4					):
															a_		:  str											=      floor(
															    (
															        (height + 2 * self.model_tester.padding - self.model_tester.kernel_size)
															        / self.model_tester.stride
															    )
															    + 1					)
															a_		:  Union[str, Any]											=      floor(
															    (
															        (width + 2 * self.model_tester.padding - self.model_tester.kernel_size)
															        / self.model_tester.stride
															    )
															    + 1					)
											# verify the first hidden states (first block)
											self.assertListEqual(
											    list(hidden_states[0].shape[-2:]					)  ,						[
											        height * width,
											        self.model_tester.hidden_sizes[0],
											    ]  ,						)

							a_				,			a_		:  Optional[Any]											=      self.model_tester.prepare_config_and_inputs_for_common()

							for model_class in self.all_model_classes:
											a_		:  List[str]											=      True
											check_hidden_states_output(__lowercase  ,						__lowercase  ,						__lowercase					)

											# check that output_hidden_states also work using config
											del inputs_dict["output_hidden_states"]
											a_		:  Union[str, Any]											=      True

											check_hidden_states_output(__lowercase  ,						__lowercase  ,						__lowercase					)






			@unittest.skip('''Will be fixed soon by reducing the size of the model used for common tests.'''					)
			def 			SCREAMING_SNAKE_CASE      ( self      :			Optional[int]					)			->			Optional[int]:
							pass






			def 			SCREAMING_SNAKE_CASE      ( self      :			int  ,						__SCREAMING_SNAKE_CASE      :			List[str]  ,						__SCREAMING_SNAKE_CASE      :			List[str]  ,						__SCREAMING_SNAKE_CASE      :			Dict=False					)			->			Any:
							a_		:  Optional[int]											=      super()._prepare_for_class(__lowercase  ,						__lowercase  ,						return_labels=__lowercase					)

							if return_labels:
											if model_class.__name__ == "LevitForImageClassificationWithTeacher":
															del inputs_dict["labels"]

							return inputs_dict






			def 			SCREAMING_SNAKE_CASE      ( self      :			str					)			->			Any:
							a_		:  int											=      self.model_tester.prepare_config_and_inputs()
							self.model_tester.create_and_check_model(*__lowercase					)






			def 			SCREAMING_SNAKE_CASE      ( self      :			Union[str, Any]					)			->			int:
							a_		:  Optional[int]											=      self.model_tester.prepare_config_and_inputs()
							self.model_tester.create_and_check_for_image_classification(*__lowercase					)






			def 			SCREAMING_SNAKE_CASE      ( self      :			Dict					)			->			Any:
							if not self.model_tester.is_training:
											return

							a_				,			a_		:  Optional[Any]											=      self.model_tester.prepare_config_and_inputs_for_common()
							a_		:  str											=      True

							for model_class in self.all_model_classes:
											# LevitForImageClassificationWithTeacher supports inference-only
											if (
											    model_class in get_values(__lowercase					)
											    or model_class.__name__ == "LevitForImageClassificationWithTeacher"
											):
															continue
											a_		:  Optional[Any]											=      model_class(__lowercase					)
											model.to(__lowercase					)
											model.train()
											a_		:  List[str]											=      self._prepare_for_class(__lowercase  ,						__lowercase  ,						return_labels=__lowercase					)
											a_		:  Tuple											=      model(**__lowercase					).loss
											loss.backward()






			def 			SCREAMING_SNAKE_CASE      ( self      :			Optional[int]					)			->			Dict:
							a_				,			a_		:  Tuple											=      self.model_tester.prepare_config_and_inputs_for_common()
							if not self.model_tester.is_training:
											return

							a_		:  Dict											=      False
							a_		:  List[str]											=      True

							for model_class in self.all_model_classes:
											if model_class in get_values(__lowercase					) or not model_class.supports_gradient_checkpointing:
															continue
											# LevitForImageClassificationWithTeacher supports inference-only
											if model_class.__name__ == "LevitForImageClassificationWithTeacher":
															continue
											a_		:  Tuple											=      model_class(__lowercase					)
											model.gradient_checkpointing_enable()
											model.to(__lowercase					)
											model.train()
											a_		:  Optional[int]											=      self._prepare_for_class(__lowercase  ,						__lowercase  ,						return_labels=__lowercase					)
											a_		:  Any											=      model(**__lowercase					).loss
											loss.backward()






			def 			SCREAMING_SNAKE_CASE      ( self      :			Optional[Any]					)			->			Tuple:
							a_				,			a_		:  Any											=      self.model_tester.prepare_config_and_inputs_for_common()

							a_		:  int											=      [
							    {'''title''': '''multi_label_classification''', '''num_labels''': 2, '''dtype''': torch.float},
							    {'''title''': '''single_label_classification''', '''num_labels''': 1, '''dtype''': torch.long},
							    {'''title''': '''regression''', '''num_labels''': 1, '''dtype''': torch.float},
							]

							for model_class in self.all_model_classes:
											if (
											    model_class
											    not in [
											        *get_values(__lowercase					),
											    ]
											    or model_class.__name__ == "LevitForImageClassificationWithTeacher"
											):
															continue

											for problem_type in problem_types:
															with self.subTest(msg=f'Testing {model_class} with {problem_type["title"]}'					):
																			a_		:  List[str]											=      problem_type['''title''']
																			a_		:  str											=      problem_type['''num_labels''']

																			a_		:  Union[str, Any]											=      model_class(__lowercase					)
																			model.to(__lowercase					)
																			model.train()

																			a_		:  Any											=      self._prepare_for_class(__lowercase  ,						__lowercase  ,						return_labels=__lowercase					)

																			if problem_type["num_labels"] > 1:
																							a_		:  Any											=      inputs['''labels'''].unsqueeze(1					).repeat(1  ,						problem_type['''num_labels''']					)

																			a_		:  str											=      inputs['''labels'''].to(problem_type['''dtype''']					)

																			# This tests that we do not trigger the warning form PyTorch "Using a target size that is different
																			# to the input size. This will likely lead to incorrect results due to broadcasting. Please ensure
																			# they have the same size." which is a symptom something in wrong for the regression problem.
																			# See https://github.com/huggingface/transformers/issues/11780
																			with warnings.catch_warnings(record=__lowercase					) as warning_list:
																							a_		:  List[str]											=      model(**__lowercase					).loss
																			for w in warning_list:
																							if "Using a target size that is different to the input size" in str(w.message					):
																											raise ValueError(
																											    f'Something is going wrong in the regression problem: intercepted {w.message}'					)

																			loss.backward()







			@slow
			def 			SCREAMING_SNAKE_CASE      ( self      :			Any					)			->			Any:
							for model_name in LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
											a_		:  Any											=      LevitModel.from_pretrained(__lowercase					)
											self.assertIsNotNone(__lowercase					)





def 		_UpperCAmelCase   (							):
				a_		:  List[Any]											=      Image.open('''./tests/fixtures/tests_samples/COCO/000000039769.png'''      )
				return image





@require_torch
@require_vision
class 	SCREAMING_SNAKE_CASE					(					unittest.TestCase       ):






			@cached_property
			def 			SCREAMING_SNAKE_CASE      ( self      :			int					)			->			Any:
							return LevitImageProcessor.from_pretrained(LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST[0]					)







			@slow
			def 			SCREAMING_SNAKE_CASE      ( self      :			Optional[Any]					)			->			Optional[Any]:
							a_		:  Optional[Any]											=      LevitForImageClassificationWithTeacher.from_pretrained(LEVIT_PRETRAINED_MODEL_ARCHIVE_LIST[0]					).to(
							    __lowercase					)

							a_		:  Optional[Any]											=      self.default_image_processor
							a_		:  int											=      prepare_img()
							a_		:  Optional[int]											=      image_processor(images=__lowercase  ,						return_tensors='''pt'''					).to(__lowercase					)

							# forward pass
							with torch.no_grad():
											a_		:  Any											=      model(**__lowercase					)

							# verify the logits
							a_		:  Optional[int]											=      torch.Size((1, 1000)					)
							self.assertEqual(outputs.logits.shape  ,						__lowercase					)

							a_		:  Any											=      torch.tensor([1.0448, -0.3745, -1.8317]					).to(__lowercase					)

							self.assertTrue(torch.allclose(outputs.logits[0, :3]  ,						__lowercase  ,						atol=1e-4					)					)












'''simple docstring'''







import re
import string

import numpy as np

import datasets


__lowerCAmelCase       		=      '\nReturns the rate at which the input predicted strings exactly match their references, ignoring any strings input as part of the regexes_to_ignore list.\n'

__lowerCAmelCase       		=      '\nArgs:\n    predictions: List of predicted texts.\n    references: List of reference texts.\n    regexes_to_ignore: List, defaults to None. Regex expressions of characters to\n        ignore when calculating the exact matches. Note: these regexes are removed\n        from the input data before the changes based on the options below (e.g. ignore_case,\n        ignore_punctuation, ignore_numbers) are applied.\n    ignore_case: Boolean, defaults to False. If true, turns everything\n        to lowercase so that capitalization differences are ignored.\n    ignore_punctuation: Boolean, defaults to False. If true, removes all punctuation before\n        comparing predictions and references.\n    ignore_numbers: Boolean, defaults to False. If true, removes all punctuation before\n        comparing predictions and references.\nReturns:\n    exact_match: Dictionary containing exact_match rate. Possible values are between 0.0 and 100.0, inclusive.\nExamples:\n    >>> exact_match = datasets.load_metric("exact_match")\n    >>> refs = ["the cat", "theater", "YELLING", "agent007"]\n    >>> preds = ["cat?", "theater", "yelling", "agent"]\n    >>> results = exact_match.compute(references=refs, predictions=preds)\n    >>> print(round(results["exact_match"], 1))\n    25.0\n\n    >>> exact_match = datasets.load_metric("exact_match")\n    >>> refs = ["the cat", "theater", "YELLING", "agent007"]\n    >>> preds = ["cat?", "theater", "yelling", "agent"]\n    >>> results = exact_match.compute(references=refs, predictions=preds, regexes_to_ignore=["the ", "yell"], ignore_case=True, ignore_punctuation=True)\n    >>> print(round(results["exact_match"], 1))\n    50.0\n\n\n    >>> exact_match = datasets.load_metric("exact_match")\n    >>> refs = ["the cat", "theater", "YELLING", "agent007"]\n    >>> preds = ["cat?", "theater", "yelling", "agent"]\n    >>> results = exact_match.compute(references=refs, predictions=preds, regexes_to_ignore=["the ", "yell", "YELL"], ignore_case=True, ignore_punctuation=True)\n    >>> print(round(results["exact_match"], 1))\n    75.0\n\n    >>> exact_match = datasets.load_metric("exact_match")\n    >>> refs = ["the cat", "theater", "YELLING", "agent007"]\n    >>> preds = ["cat?", "theater", "yelling", "agent"]\n    >>> results = exact_match.compute(references=refs, predictions=preds, regexes_to_ignore=["the ", "yell", "YELL"], ignore_case=True, ignore_punctuation=True, ignore_numbers=True)\n    >>> print(round(results["exact_match"], 1))\n    100.0\n\n    >>> exact_match = datasets.load_metric("exact_match")\n    >>> refs = ["The cat sat on the mat.", "Theaters are great.", "It\'s like comparing oranges and apples."]\n    >>> preds = ["The cat sat on the mat?", "Theaters are great.", "It\'s like comparing apples and oranges."]\n    >>> results = exact_match.compute(references=refs, predictions=preds)\n    >>> print(round(results["exact_match"], 1))\n    33.3\n\n'

__lowerCAmelCase       		=      '\n'





@datasets.utils.file_utils.add_start_docstrings(_DESCRIPTION	,   _KWARGS_DESCRIPTION       )
class 	SCREAMING_SNAKE_CASE					(					datasets.Metric       ):






			def 			SCREAMING_SNAKE_CASE      ( self      :			Optional[Any]					)			->			int:
							return datasets.MetricInfo(
							    description=_DESCRIPTION  ,						citation=_CITATION  ,						inputs_description=_KWARGS_DESCRIPTION  ,						features=datasets.Features(
							        {
							            '''predictions''': datasets.Value('''string'''  ,						id='''sequence'''					),
							            '''references''': datasets.Value('''string'''  ,						id='''sequence'''					),
							        }					)  ,						reference_urls=[]  ,						)







			def 			SCREAMING_SNAKE_CASE      ( self      :			str  ,						__SCREAMING_SNAKE_CASE      :			List[Any]  ,						__SCREAMING_SNAKE_CASE      :			Optional[int]  ,						__SCREAMING_SNAKE_CASE      :			Dict=None  ,						__SCREAMING_SNAKE_CASE      :			int=False  ,						__SCREAMING_SNAKE_CASE      :			Optional[int]=False  ,						__SCREAMING_SNAKE_CASE      :			Dict=False  ,						)			->			str:
							if regexes_to_ignore is not None:
											for s in regexes_to_ignore:
															a_		:  Optional[Any]											=      np.array([re.sub(__SCREAMING_SNAKE_CASE  ,						''''''  ,						__SCREAMING_SNAKE_CASE					) for x in predictions]					)
															a_		:  int											=      np.array([re.sub(__SCREAMING_SNAKE_CASE  ,						''''''  ,						__SCREAMING_SNAKE_CASE					) for x in references]					)
							else:
											a_		:  List[str]											=      np.asarray(__SCREAMING_SNAKE_CASE					)
											a_		:  Any											=      np.asarray(__SCREAMING_SNAKE_CASE					)

							if ignore_case:
											a_		:  List[str]											=      np.char.lower(__SCREAMING_SNAKE_CASE					)
											a_		:  List[Any]											=      np.char.lower(__SCREAMING_SNAKE_CASE					)

							if ignore_punctuation:
											a_		:  Any											=      string.punctuation.maketrans(''''''  ,						''''''  ,						string.punctuation					)
											a_		:  Union[str, Any]											=      np.char.translate(__SCREAMING_SNAKE_CASE  ,						table=__SCREAMING_SNAKE_CASE					)
											a_		:  int											=      np.char.translate(__SCREAMING_SNAKE_CASE  ,						table=__SCREAMING_SNAKE_CASE					)

							if ignore_numbers:
											a_		:  int											=      string.digits.maketrans(''''''  ,						''''''  ,						string.digits					)
											a_		:  Optional[int]											=      np.char.translate(__SCREAMING_SNAKE_CASE  ,						table=__SCREAMING_SNAKE_CASE					)
											a_		:  Dict											=      np.char.translate(__SCREAMING_SNAKE_CASE  ,						table=__SCREAMING_SNAKE_CASE					)

							a_		:  Optional[Any]											=      predictions == references

							return {"exact_match": np.mean(__SCREAMING_SNAKE_CASE					) * 100}




