




'''simple docstring'''



import itertools
import random
import unittest

import numpy as np

from transformers import BatchFeature, SpeechTaFeatureExtractor
from transformers.testing_utils import require_torch
from transformers.utils.import_utils import is_torch_available

from ...test_sequence_feature_extraction_common import SequenceFeatureExtractionTestMixin


if is_torch_available():
      import torch


UpperCamelCase_    	=				random.Random()




def   lowercase__(			__UpperCamelCase:					int      ,__UpperCamelCase:					Tuple=1.0      ,__UpperCamelCase:					int=None      ,__UpperCamelCase:					str=None    ):

      """simple docstring"""






      if rng is None:
            SCREAMING_SNAKE_CASE   :      Union[str, Any]    					=						global_rng

      SCREAMING_SNAKE_CASE   :      int    					=						[]
      for batch_idx in range(shape[0]    ):
            values.append([]    )
            for _ in range(shape[1]    ):
                  values[-1].append(rng.random() * scale    )

      return values






@require_torch
class 							_a				(			unittest.TestCase ):





       '''simple docstring'''






       def __init__(      self,							A,							A=7,							A=400,							A=2_000,							A=1,							A=0.0,							A=16_000,							A=True,							A=80,							A=16,							A=64,							A="hann_window",							A=80,							A=7_600,							A=1E-10,							A=True,							):







             '''simple docstring'''







             SCREAMING_SNAKE_CASE   :      List[Any]    					=						parent
             SCREAMING_SNAKE_CASE   :      Union[str, Any]    					=						batch_size
             SCREAMING_SNAKE_CASE   :      Union[str, Any]    					=						min_seq_length
             SCREAMING_SNAKE_CASE   :      List[str]    					=						max_seq_length
             SCREAMING_SNAKE_CASE   :      Optional[Any]    					=						(self.max_seq_length - self.min_seq_length) // (self.batch_size - 1)
             SCREAMING_SNAKE_CASE   :      Union[str, Any]    					=						feature_size
             SCREAMING_SNAKE_CASE   :      Optional[Any]    					=						padding_value
             SCREAMING_SNAKE_CASE   :      Optional[int]    					=						sampling_rate
             SCREAMING_SNAKE_CASE   :      Optional[Any]    					=						do_normalize
             SCREAMING_SNAKE_CASE   :      Tuple    					=						num_mel_bins
             SCREAMING_SNAKE_CASE   :      Dict    					=						hop_length
             SCREAMING_SNAKE_CASE   :      Optional[Any]    					=						win_length
             SCREAMING_SNAKE_CASE   :      Optional[Any]    					=						win_function
             SCREAMING_SNAKE_CASE   :      Optional[int]    					=						fmin
             SCREAMING_SNAKE_CASE   :      List[Any]    					=						fmax
             SCREAMING_SNAKE_CASE   :      str    					=						mel_floor
             SCREAMING_SNAKE_CASE   :      Any    					=						return_attention_mask







       def        UpperCamelCase_							(      self  ):







             '''simple docstring'''







             return {
                 "feature_size": self.feature_size,
                 "padding_value": self.padding_value,
                 "sampling_rate": self.sampling_rate,
                 "do_normalize": self.do_normalize,
                 "num_mel_bins": self.num_mel_bins,
                 "hop_length": self.hop_length,
                 "win_length": self.win_length,
                 "win_function": self.win_function,
                 "fmin": self.fmin,
                 "fmax": self.fmax,
                 "mel_floor": self.mel_floor,
                 "return_attention_mask": self.return_attention_mask,
             }







       def        UpperCamelCase_							(      self,							A=False,							A=False  ):







             '''simple docstring'''







             def _flatten(A  ):
                   return list(itertools.chain(*A  )  )

             if equal_length:
                   SCREAMING_SNAKE_CASE   :      Tuple    					=						floats_list((self.batch_size, self.max_seq_length)  )
             else:
                   # make sure that inputs increase in size
                   SCREAMING_SNAKE_CASE   :      str    					=						[
                       _flatten(floats_list((x, self.feature_size)  )  )
                       for x in range(self.min_seq_length,							self.max_seq_length,							self.seq_length_diff  )
                   ]

             if numpify:
                   SCREAMING_SNAKE_CASE   :      Union[str, Any]    					=						[np.asarray(A  ) for x in speech_inputs]

             return speech_inputs







       def        UpperCamelCase_							(      self,							A=False,							A=False  ):







             '''simple docstring'''







             if equal_length:
                   SCREAMING_SNAKE_CASE   :      int    					=						[floats_list((self.max_seq_length, self.num_mel_bins)  ) for _ in range(self.batch_size  )]
             else:
                   # make sure that inputs increase in size
                   SCREAMING_SNAKE_CASE   :      int    					=						[
                       floats_list((x, self.num_mel_bins)  )
                       for x in range(self.min_seq_length,							self.max_seq_length,							self.seq_length_diff  )
                   ]

             if numpify:
                   SCREAMING_SNAKE_CASE   :      Tuple    					=						[np.asarray(A  ) for x in speech_inputs]

             return speech_inputs






@require_torch
class 							_a				(			SCREAMING_SNAKE_CASE ,      unittest.TestCase ):





       '''simple docstring'''






       A						:				List[Any]        =						SpeechTaFeatureExtractor







       def        UpperCamelCase_							(      self  ):







             '''simple docstring'''







             SCREAMING_SNAKE_CASE   :      Dict    					=						SpeechTaFeatureExtractionTester(self  )







       def        UpperCamelCase_							(      self,							A  ):







             '''simple docstring'''







             self.assertTrue(np.all(np.mean(A,							axis=0  ) < 1E-3  )  )
             self.assertTrue(np.all(np.abs(np.var(A,							axis=0  ) - 1  ) < 1E-3  )  )







       def        UpperCamelCase_							(      self  ):







             '''simple docstring'''







             SCREAMING_SNAKE_CASE   :      str    					=						self.feature_extraction_class(**self.feat_extract_tester.prepare_feat_extract_dict()  )
             # create three inputs of length 800, 1000, and 1200
             SCREAMING_SNAKE_CASE   :      Dict    					=						[floats_list((1, x)  )[0] for x in range(800,							1_400,							200  )]
             SCREAMING_SNAKE_CASE   :      List[Any]    					=						[np.asarray(A  ) for speech_input in speech_inputs]

             # Test not batched input
             SCREAMING_SNAKE_CASE   :      Dict    					=						feat_extract(speech_inputs[0],							return_tensors='np'  ).input_values
             SCREAMING_SNAKE_CASE   :      Tuple    					=						feat_extract(np_speech_inputs[0],							return_tensors='np'  ).input_values
             self.assertTrue(np.allclose(A,							A,							atol=1E-3  )  )

             # Test batched
             SCREAMING_SNAKE_CASE   :      List[Any]    					=						feat_extract(A,							return_tensors='np'  ).input_values
             SCREAMING_SNAKE_CASE   :      Tuple    					=						feat_extract(A,							return_tensors='np'  ).input_values
             for enc_seq_a, enc_seq_a in zip(A,							A  ):
                   self.assertTrue(np.allclose(A,							A,							atol=1E-3  )  )







       def        UpperCamelCase_							(      self  ):







             '''simple docstring'''







             SCREAMING_SNAKE_CASE   :      Optional[Any]    					=						self.feature_extraction_class(**self.feat_extract_tester.prepare_feat_extract_dict()  )
             SCREAMING_SNAKE_CASE   :      List[str]    					=						[floats_list((1, x)  )[0] for x in range(800,							1_400,							200  )]

             SCREAMING_SNAKE_CASE   :      Dict    					=						['longest', 'max_length', 'do_not_pad']
             SCREAMING_SNAKE_CASE   :      Dict    					=						[None, 1_600, None]
             for max_length, padding in zip(A,							A  ):
                   SCREAMING_SNAKE_CASE   :      Dict    					=						feat_extract(A,							padding=A,							max_length=A,							return_tensors='np'  )
                   SCREAMING_SNAKE_CASE   :      Dict    					=						processed.input_values

                   self._check_zero_mean_unit_variance(input_values[0][:800]  )
                   self.assertTrue(input_values[0][800:].sum() < 1E-6  )
                   self._check_zero_mean_unit_variance(input_values[1][:1_000]  )
                   self.assertTrue(input_values[0][1_000:].sum() < 1E-6  )
                   self._check_zero_mean_unit_variance(input_values[2][:1_200]  )







       def        UpperCamelCase_							(      self  ):







             '''simple docstring'''







             SCREAMING_SNAKE_CASE   :      List[str]    					=						self.feature_extraction_class(**self.feat_extract_tester.prepare_feat_extract_dict()  )
             SCREAMING_SNAKE_CASE   :      List[str]    					=						range(800,							1_400,							200  )
             SCREAMING_SNAKE_CASE   :      List[Any]    					=						[floats_list((1, x)  )[0] for x in lengths]

             SCREAMING_SNAKE_CASE   :      str    					=						['longest', 'max_length', 'do_not_pad']
             SCREAMING_SNAKE_CASE   :      int    					=						[None, 1_600, None]

             for max_length, padding in zip(A,							A  ):
                   SCREAMING_SNAKE_CASE   :      List[str]    					=						feat_extract(A,							max_length=A,							padding=A  )
                   SCREAMING_SNAKE_CASE   :      Optional[int]    					=						processed.input_values

                   self._check_zero_mean_unit_variance(input_values[0][:800]  )
                   self._check_zero_mean_unit_variance(input_values[1][:1_000]  )
                   self._check_zero_mean_unit_variance(input_values[2][:1_200]  )







       def        UpperCamelCase_							(      self  ):







             '''simple docstring'''







             SCREAMING_SNAKE_CASE   :      int    					=						self.feature_extraction_class(**self.feat_extract_tester.prepare_feat_extract_dict()  )
             SCREAMING_SNAKE_CASE   :      List[str]    					=						[floats_list((1, x)  )[0] for x in range(800,							1_400,							200  )]
             SCREAMING_SNAKE_CASE   :      Dict    					=						feat_extract(
                 A,							truncation=A,							max_length=1_000,							padding='max_length',							return_tensors='np'  )
             SCREAMING_SNAKE_CASE   :      Tuple    					=						processed.input_values

             self._check_zero_mean_unit_variance(input_values[0, :800]  )
             self._check_zero_mean_unit_variance(input_values[1]  )
             self._check_zero_mean_unit_variance(input_values[2]  )







       def        UpperCamelCase_							(      self  ):







             '''simple docstring'''







             SCREAMING_SNAKE_CASE   :      Dict    					=						self.feature_extraction_class(**self.feat_extract_tester.prepare_feat_extract_dict()  )
             SCREAMING_SNAKE_CASE   :      Union[str, Any]    					=						[floats_list((1, x)  )[0] for x in range(800,							1_400,							200  )]
             SCREAMING_SNAKE_CASE   :      int    					=						feat_extract(
                 A,							truncation=A,							max_length=1_000,							padding='longest',							return_tensors='np'  )
             SCREAMING_SNAKE_CASE   :      Tuple    					=						processed.input_values

             self._check_zero_mean_unit_variance(input_values[0, :800]  )
             self._check_zero_mean_unit_variance(input_values[1, :1_000]  )
             self._check_zero_mean_unit_variance(input_values[2]  )

             # make sure that if max_length < longest -> then pad to max_length
             self.assertTrue(input_values.shape == (3, 1_000)  )

             SCREAMING_SNAKE_CASE   :      Tuple    					=						[floats_list((1, x)  )[0] for x in range(800,							1_400,							200  )]
             SCREAMING_SNAKE_CASE   :      Tuple    					=						feat_extract(
                 A,							truncation=A,							max_length=2_000,							padding='longest',							return_tensors='np'  )
             SCREAMING_SNAKE_CASE   :      Optional[Any]    					=						processed.input_values

             self._check_zero_mean_unit_variance(input_values[0, :800]  )
             self._check_zero_mean_unit_variance(input_values[1, :1_000]  )
             self._check_zero_mean_unit_variance(input_values[2]  )

             # make sure that if max_length > longest -> then pad to longest
             self.assertTrue(input_values.shape == (3, 1_200)  )







       def        UpperCamelCase_							(      self  ):







             '''simple docstring'''







             SCREAMING_SNAKE_CASE   :      Optional[Any]    					=						self.feature_extraction_class(**self.feat_extract_tester.prepare_feat_extract_dict()  )
             SCREAMING_SNAKE_CASE   :      Optional[Any]    					=						np.random.rand(100  ).astype(np.floataa  )
             SCREAMING_SNAKE_CASE   :      Optional[Any]    					=						np_speech_inputs.tolist()

             for inputs in [py_speech_inputs, np_speech_inputs]:
                   SCREAMING_SNAKE_CASE   :      Union[str, Any]    					=						feature_extractor.pad([{'input_values': inputs}],							return_tensors='np'  )
                   self.assertTrue(np_processed.input_values.dtype == np.floataa  )
                   SCREAMING_SNAKE_CASE   :      List[str]    					=						feature_extractor.pad([{'input_values': inputs}],							return_tensors='pt'  )
                   self.assertTrue(pt_processed.input_values.dtype == torch.floataa  )







       def        UpperCamelCase_							(      self  ):







             '''simple docstring'''







             SCREAMING_SNAKE_CASE   :      List[str]    					=						self.feature_extraction_class(**self.feat_extract_tester.prepare_feat_extract_dict()  )
             # create three inputs of length 800, 1000, and 1200
             SCREAMING_SNAKE_CASE   :      List[Any]    					=						[floats_list((1, x)  )[0] for x in range(800,							1_400,							200  )]
             SCREAMING_SNAKE_CASE   :      int    					=						[np.asarray(A  ) for speech_input in speech_inputs]

             # Test feature size
             SCREAMING_SNAKE_CASE   :      Any    					=						feature_extractor(audio_target=A,							padding=A,							return_tensors='np'  ).input_values
             self.assertTrue(input_values.ndim == 3  )
             self.assertTrue(input_values.shape[-1] == feature_extractor.num_mel_bins  )

             # Test not batched input
             SCREAMING_SNAKE_CASE   :      str    					=						feature_extractor(speech_inputs[0],							return_tensors='np'  ).input_values
             SCREAMING_SNAKE_CASE   :      Tuple    					=						feature_extractor(np_speech_inputs[0],							return_tensors='np'  ).input_values
             self.assertTrue(np.allclose(A,							A,							atol=1E-3  )  )

             # Test batched
             SCREAMING_SNAKE_CASE   :      Optional[int]    					=						feature_extractor(A,							return_tensors='np'  ).input_values
             SCREAMING_SNAKE_CASE   :      int    					=						feature_extractor(A,							return_tensors='np'  ).input_values
             for enc_seq_a, enc_seq_a in zip(A,							A  ):
                   self.assertTrue(np.allclose(A,							A,							atol=1E-3  )  )

             # Test 2-D numpy arrays are batched.
             SCREAMING_SNAKE_CASE   :      List[Any]    					=						[floats_list((1, x)  )[0] for x in (800, 800, 800)]
             SCREAMING_SNAKE_CASE   :      Optional[Any]    					=						np.asarray(A  )
             SCREAMING_SNAKE_CASE   :      int    					=						feature_extractor(A,							return_tensors='np'  ).input_values
             SCREAMING_SNAKE_CASE   :      Tuple    					=						feature_extractor(A,							return_tensors='np'  ).input_values
             for enc_seq_a, enc_seq_a in zip(A,							A  ):
                   self.assertTrue(np.allclose(A,							A,							atol=1E-3  )  )







       def        UpperCamelCase_							(      self  ):







             '''simple docstring'''







             SCREAMING_SNAKE_CASE   :      int    					=						self.feat_extract_tester.prepare_inputs_for_target()
             SCREAMING_SNAKE_CASE   :      List[Any]    					=						self.feature_extraction_class(**self.feat_extract_dict  )
             SCREAMING_SNAKE_CASE   :      str    					=						feat_extract.model_input_names[0]

             SCREAMING_SNAKE_CASE   :      Any    					=						BatchFeature({input_name: speech_inputs}  )

             self.assertTrue(all(len(A  ) == len(A  ) for x, y in zip(A,							processed_features[input_name]  )  )  )

             SCREAMING_SNAKE_CASE   :      Union[str, Any]    					=						self.feat_extract_tester.prepare_inputs_for_target(equal_length=A  )
             SCREAMING_SNAKE_CASE   :      Dict    					=						BatchFeature({input_name: speech_inputs},							tensor_type='np'  )

             SCREAMING_SNAKE_CASE   :      Dict    					=						processed_features[input_name]

             if len(batch_features_input.shape  ) < 3:
                   SCREAMING_SNAKE_CASE   :      str    					=						batch_features_input[:, :, None]

             self.assertTrue(
                 batch_features_input.shape
                 == (self.feat_extract_tester.batch_size, len(speech_inputs[0]  ), self.feat_extract_tester.num_mel_bins)  )







       @require_torch
       def        UpperCamelCase_							(      self  ):







             '''simple docstring'''







             SCREAMING_SNAKE_CASE   :      str    					=						self.feat_extract_tester.prepare_inputs_for_target(equal_length=A  )
             SCREAMING_SNAKE_CASE   :      Dict    					=						self.feature_extraction_class(**self.feat_extract_dict  )
             SCREAMING_SNAKE_CASE   :      List[Any]    					=						feat_extract.model_input_names[0]

             SCREAMING_SNAKE_CASE   :      Tuple    					=						BatchFeature({input_name: speech_inputs},							tensor_type='pt'  )

             SCREAMING_SNAKE_CASE   :      List[Any]    					=						processed_features[input_name]

             if len(batch_features_input.shape  ) < 3:
                   SCREAMING_SNAKE_CASE   :      Union[str, Any]    					=						batch_features_input[:, :, None]

             self.assertTrue(
                 batch_features_input.shape
                 == (self.feat_extract_tester.batch_size, len(speech_inputs[0]  ), self.feat_extract_tester.num_mel_bins)  )







       @require_torch
       def        UpperCamelCase_							(      self  ):







             '''simple docstring'''







             SCREAMING_SNAKE_CASE   :      int    					=						self.feature_extraction_class(**self.feat_extract_dict  )
             SCREAMING_SNAKE_CASE   :      Tuple    					=						self.feat_extract_tester.prepare_inputs_for_target()
             SCREAMING_SNAKE_CASE   :      Dict    					=						feat_extract.model_input_names[0]

             SCREAMING_SNAKE_CASE   :      Dict    					=						BatchFeature({input_name: speech_inputs}  )

             SCREAMING_SNAKE_CASE   :      str    					=						feat_extract.num_mel_bins  # hack!

             SCREAMING_SNAKE_CASE   :      Optional[Any]    					=						feat_extract.pad(A,							padding='longest',							return_tensors='np'  )[input_name]
             SCREAMING_SNAKE_CASE   :      Dict    					=						feat_extract.pad(A,							padding='longest',							return_tensors='pt'  )[input_name]

             self.assertTrue(abs(input_np.astype(np.floataa  ).sum() - input_pt.numpy().astype(np.floataa  ).sum()  ) < 1E-2  )







       def        UpperCamelCase_							(      self  ):







             '''simple docstring'''







             SCREAMING_SNAKE_CASE   :      Optional[Any]    					=						self.feat_extract_dict
             SCREAMING_SNAKE_CASE   :      str    					=						True
             SCREAMING_SNAKE_CASE   :      List[str]    					=						self.feature_extraction_class(**A  )
             SCREAMING_SNAKE_CASE   :      Tuple    					=						self.feat_extract_tester.prepare_inputs_for_target()
             SCREAMING_SNAKE_CASE   :      Optional[Any]    					=						[len(A  ) for x in speech_inputs]
             SCREAMING_SNAKE_CASE   :      Any    					=						feat_extract.model_input_names[0]

             SCREAMING_SNAKE_CASE   :      Dict    					=						BatchFeature({input_name: speech_inputs}  )

             SCREAMING_SNAKE_CASE   :      int    					=						feat_extract.num_mel_bins  # hack!

             SCREAMING_SNAKE_CASE   :      List[Any]    					=						feat_extract.pad(A,							padding='longest',							return_tensors='np'  )
             self.assertIn('attention_mask',							A  )
             self.assertListEqual(list(processed.attention_mask.shape  ),							list(processed[input_name].shape[:2]  )  )
             self.assertListEqual(processed.attention_mask.sum(-1  ).tolist(),							A  )







       def        UpperCamelCase_							(      self  ):







             '''simple docstring'''







             SCREAMING_SNAKE_CASE   :      int    					=						self.feat_extract_dict
             SCREAMING_SNAKE_CASE   :      Dict    					=						True
             SCREAMING_SNAKE_CASE   :      str    					=						self.feature_extraction_class(**A  )
             SCREAMING_SNAKE_CASE   :      Optional[int]    					=						self.feat_extract_tester.prepare_inputs_for_target()
             SCREAMING_SNAKE_CASE   :      Any    					=						[len(A  ) for x in speech_inputs]
             SCREAMING_SNAKE_CASE   :      Tuple    					=						feat_extract.model_input_names[0]

             SCREAMING_SNAKE_CASE   :      int    					=						BatchFeature({input_name: speech_inputs}  )
             SCREAMING_SNAKE_CASE   :      Union[str, Any]    					=						min(A  )

             SCREAMING_SNAKE_CASE   :      str    					=						feat_extract.num_mel_bins  # hack!

             SCREAMING_SNAKE_CASE   :      Tuple    					=						feat_extract.pad(
                 A,							padding='max_length',							max_length=A,							truncation=A,							return_tensors='np'  )
             self.assertIn('attention_mask',							A  )
             self.assertListEqual(
                 list(processed_pad.attention_mask.shape  ),							[processed_pad[input_name].shape[0], max_length]  )
             self.assertListEqual(
                 processed_pad.attention_mask[:, :max_length].sum(-1  ).tolist(),							[max_length for x in speech_inputs]  )







       def        UpperCamelCase_							(      self,							A  ):







             '''simple docstring'''







             from datasets import load_dataset

             SCREAMING_SNAKE_CASE   :      str    					=						load_dataset('hf-internal-testing/librispeech_asr_dummy',							'clean',							split='validation'  )
             # automatic decoding with librispeech
             SCREAMING_SNAKE_CASE   :      Dict    					=						ds.sort('id'  ).select(range(A  )  )[:num_samples]['audio']

             return [x["array"] for x in speech_samples]







       def        UpperCamelCase_							(      self  ):







             '''simple docstring'''







             SCREAMING_SNAKE_CASE   :      List[Any]    					=						torch.tensor(
                 [2.3804E-03, 2.0752E-03, 1.9836E-03, 2.1057E-03, 1.6174E-03,
                  3.0518E-04, 9.1553E-05, 3.3569E-04, 9.7656E-04, 1.8311E-03,
                  2.0142E-03, 2.1057E-03, 1.7395E-03, 4.5776E-04, -3.9673E-04,
                  4.5776E-04, 1.0071E-03, 9.1553E-05, 4.8828E-04, 1.1597E-03,
                  7.3242E-04, 9.4604E-04, 1.8005E-03, 1.8311E-03, 8.8501E-04,
                  4.2725E-04, 4.8828E-04, 7.3242E-04, 1.0986E-03, 2.1057E-03]  )
             # fmt: on

             SCREAMING_SNAKE_CASE   :      str    					=						self._load_datasamples(1  )
             SCREAMING_SNAKE_CASE   :      Dict    					=						SpeechTaFeatureExtractor()
             SCREAMING_SNAKE_CASE   :      Tuple    					=						feature_extractor(A,							return_tensors='pt'  ).input_values
             self.assertEquals(input_values.shape,							(1, 93_680)  )
             self.assertTrue(torch.allclose(input_values[0, :30],							A,							atol=1E-6  )  )







       def        UpperCamelCase_							(      self  ):







             '''simple docstring'''







             SCREAMING_SNAKE_CASE   :      List[str]    					=						torch.tensor(
                 [-2.68_70, -3.01_04, -3.13_56, -3.53_52, -3.00_44, -3.03_53, -3.47_19, -3.67_77,
                  -3.15_20, -2.94_35, -2.65_53, -2.87_95, -2.99_44, -2.59_21, -3.02_79, -3.03_86,
                  -3.08_64, -3.12_91, -3.23_53, -2.74_44, -2.68_31, -2.72_87, -3.17_61, -3.15_71,
                  -3.27_26, -3.05_82, -3.10_07, -3.45_33, -3.46_95, -3.09_98]  )
             # fmt: on

             SCREAMING_SNAKE_CASE   :      Optional[int]    					=						self._load_datasamples(1  )
             SCREAMING_SNAKE_CASE   :      Optional[Any]    					=						SpeechTaFeatureExtractor()
             SCREAMING_SNAKE_CASE   :      Optional[int]    					=						feature_extractor(audio_target=A,							return_tensors='pt'  ).input_values
             self.assertEquals(input_values.shape,							(1, 366, 80)  )
             self.assertTrue(torch.allclose(input_values[0, 0, :30],							A,							atol=1E-4  )  )





from ..utils import DummyObject, requires_backends



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  List[str]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Any    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  List[Any]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  List[Any]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  List[Any]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Union[str, Any]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Dict    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  List[Any]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  List[str]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  List[Any]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  List[Any]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Any    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Optional[int]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  str    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Dict    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  int    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  int    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  str    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  List[Any]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  List[str]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Optional[int]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Union[str, Any]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Tuple    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  List[Any]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  str    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Dict    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  str    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Any    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Union[str, Any]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Optional[Any]    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



class        _a		(metaclass=__magic_name__							):


					'''simple docstring'''






					UpperCAmelCase__:  Tuple    				=			['''sentencepiece''']






					def __init__(					self       ,			*A__       ,			**A__     ):
						requires_backends(self       ,			["""sentencepiece"""]     )



