code: 
  
  
  
  
  """simple docstring"""
  
  import shutil
  import tempfile
  import unittest
  
  import pytest
  
  from transformers import WhisperTokenizer, is_speech_available
  from transformers.testing_utils import require_sentencepiece, require_torch, require_torchaudio
  
  from .test_feature_extraction_whisper import floats_list
  
  
  if is_speech_available():
  							from transformers import WhisperFeatureExtractor, WhisperProcessor
  
  
  __A 		=			50_358
  __A 		=			50_362
  @require_torch
  @require_torchaudio
  @require_sentencepiece
  class 			lowerCamelCase__    (  unittest.TestCase			):
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						List[str]								=				"openai/whisper-small.en"
  					snake_case		:						Tuple								=				tempfile.mkdtemp()
  
  
  			def 							lowerCamelCase_				(     self				, **SCREAMING_SNAKE_CASE							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					return WhisperTokenizer.from_pretrained(self.checkpoint				, **SCREAMING_SNAKE_CASE							)
  
  
  			def 							lowerCamelCase_				(     self				, **SCREAMING_SNAKE_CASE							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					return WhisperFeatureExtractor.from_pretrained(self.checkpoint				, **SCREAMING_SNAKE_CASE							)
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					shutil.rmtree(self.tmpdirname							)
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						str								=				self.get_tokenizer()
  					snake_case		:						Dict								=				self.get_feature_extractor()
  
  					snake_case		:						Any								=				WhisperProcessor(tokenizer=SCREAMING_SNAKE_CASE				, feature_extractor=SCREAMING_SNAKE_CASE							)
  
  					processor.save_pretrained(self.tmpdirname							)
  					snake_case		:						List[Any]								=				WhisperProcessor.from_pretrained(self.tmpdirname							)
  
  					self.assertEqual(processor.tokenizer.get_vocab()				, tokenizer.get_vocab()							)
  					self.assertIsInstance(processor.tokenizer				, SCREAMING_SNAKE_CASE							)
  
  					self.assertEqual(processor.feature_extractor.to_json_string()				, feature_extractor.to_json_string()							)
  					self.assertIsInstance(processor.feature_extractor				, SCREAMING_SNAKE_CASE							)
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						Tuple								=				WhisperProcessor(tokenizer=self.get_tokenizer()				, feature_extractor=self.get_feature_extractor()							)
  					processor.save_pretrained(self.tmpdirname							)
  
  					snake_case		:						Union[str, Any]								=				self.get_tokenizer(bos_token="(BOS)"				, eos_token="(EOS)"							)
  					snake_case		:						List[str]								=				self.get_feature_extractor(do_normalize=SCREAMING_SNAKE_CASE				, padding_value=1.0							)
  
  					snake_case		:						Union[str, Any]								=				WhisperProcessor.from_pretrained(
  					    self.tmpdirname				, bos_token="(BOS)"				, eos_token="(EOS)"				, do_normalize=SCREAMING_SNAKE_CASE				, padding_value=1.0							)
  
  					self.assertEqual(processor.tokenizer.get_vocab()				, tokenizer_add_kwargs.get_vocab()							)
  					self.assertIsInstance(processor.tokenizer				, SCREAMING_SNAKE_CASE							)
  
  					self.assertEqual(processor.feature_extractor.to_json_string()				, feature_extractor_add_kwargs.to_json_string()							)
  					self.assertIsInstance(processor.feature_extractor				, SCREAMING_SNAKE_CASE							)
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						List[str]								=				self.get_feature_extractor()
  					snake_case		:						Optional[Any]								=				self.get_tokenizer()
  
  					snake_case		:						int								=				WhisperProcessor(tokenizer=SCREAMING_SNAKE_CASE				, feature_extractor=SCREAMING_SNAKE_CASE							)
  
  					snake_case		:						Any								=				floats_list((3, 1_000)							)
  
  					snake_case		:						Dict								=				feature_extractor(SCREAMING_SNAKE_CASE				, return_tensors="np"							)
  					snake_case		:						Dict								=				processor(SCREAMING_SNAKE_CASE				, return_tensors="np"							)
  
  					for key in input_feat_extract.keys():
  							self.assertAlmostEqual(input_feat_extract[key].sum()				, input_processor[key].sum()				, delta=1E-2							)
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						List[str]								=				self.get_feature_extractor()
  					snake_case		:						str								=				self.get_tokenizer()
  
  					snake_case		:						Dict								=				WhisperProcessor(tokenizer=SCREAMING_SNAKE_CASE				, feature_extractor=SCREAMING_SNAKE_CASE							)
  
  					snake_case		:						Any								=				"This is a test string"
  
  					snake_case		:						str								=				processor(text=SCREAMING_SNAKE_CASE							)
  
  					snake_case		:						Union[str, Any]								=				tokenizer(SCREAMING_SNAKE_CASE							)
  
  					for key in encoded_tok.keys():
  							self.assertListEqual(encoded_tok[key]				, encoded_processor[key]							)
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						List[str]								=				self.get_feature_extractor()
  					snake_case		:						List[Any]								=				self.get_tokenizer()
  
  					snake_case		:						Optional[Any]								=				WhisperProcessor(tokenizer=SCREAMING_SNAKE_CASE				, feature_extractor=SCREAMING_SNAKE_CASE							)
  
  					snake_case		:						int								=				[[1, 4, 5, 8, 1, 0, 8], [3, 4, 3, 1, 1, 8, 9]]
  
  					snake_case		:						Optional[int]								=				processor.batch_decode(SCREAMING_SNAKE_CASE							)
  					snake_case		:						Optional[int]								=				tokenizer.batch_decode(SCREAMING_SNAKE_CASE							)
  
  					self.assertListEqual(SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE							)
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						Optional[Any]								=				self.get_feature_extractor()
  					snake_case		:						Union[str, Any]								=				self.get_tokenizer()
  
  					snake_case		:						Dict								=				WhisperProcessor(tokenizer=SCREAMING_SNAKE_CASE				, feature_extractor=SCREAMING_SNAKE_CASE							)
  
  					self.assertListEqual(
  					    processor.model_input_names				, feature_extractor.model_input_names				, msg="`processor` and `feature_extractor` model input names do not match"				, )
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						Dict								=				self.get_feature_extractor()
  					snake_case		:						Any								=				self.get_tokenizer()
  
  					snake_case		:						Dict								=				WhisperProcessor(tokenizer=SCREAMING_SNAKE_CASE				, feature_extractor=SCREAMING_SNAKE_CASE							)
  					snake_case		:						Tuple								=				processor.get_decoder_prompt_ids(task="transcribe"				, no_timestamps=SCREAMING_SNAKE_CASE							)
  
  					self.assertIsInstance(SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE							)
  					for ids in forced_decoder_ids:
  							self.assertIsInstance(SCREAMING_SNAKE_CASE				, (list, tuple)							)
  
  					snake_case		:						int								=				[TRANSCRIBE, NOTIMESTAMPS]
  					self.assertListEqual([ids[-1] for ids in forced_decoder_ids]				, SCREAMING_SNAKE_CASE							)
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						List[str]								=				WhisperProcessor(tokenizer=self.get_tokenizer()				, feature_extractor=self.get_feature_extractor()							)
  					snake_case		:						Any								=				processor.get_prompt_ids("Mr. Quilter"							)
  					snake_case		:						int								=				processor.tokenizer.decode(SCREAMING_SNAKE_CASE							)
  
  					self.assertListEqual(prompt_ids.tolist()				, [50_360, 1_770, 13, 2_264, 346, 353]							)
  					self.assertEqual(SCREAMING_SNAKE_CASE				, "<|startofprev|> Mr. Quilter"							)
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						Optional[Any]								=				WhisperProcessor(tokenizer=self.get_tokenizer()				, feature_extractor=self.get_feature_extractor()							)
  					snake_case		:						Optional[Any]								=				processor.get_prompt_ids(""							)
  					snake_case		:						Tuple								=				processor.tokenizer.decode(SCREAMING_SNAKE_CASE							)
  
  					self.assertListEqual(prompt_ids.tolist()				, [50_360, 220]							)
  					self.assertEqual(SCREAMING_SNAKE_CASE				, "<|startofprev|> "							)
  
  
  
  			def 							lowerCamelCase_				(     self							):
  
  
  
  					"""simple docstring"""
  
  
  
  
  
  
  
  					snake_case		:						Optional[Any]								=				WhisperProcessor(tokenizer=self.get_tokenizer()				, feature_extractor=self.get_feature_extractor()							)
  
  					def _test_prompt_error_raised_helper(SCREAMING_SNAKE_CASE				, SCREAMING_SNAKE_CASE							):
  							with pytest.raises(SCREAMING_SNAKE_CASE							) as excinfo:
  									processor.get_prompt_ids(SCREAMING_SNAKE_CASE							)
  							snake_case		:						Any								=				F'''Encountered text in the prompt corresponding to disallowed special token: {special_token}.'''
  							self.assertEqual(SCREAMING_SNAKE_CASE				, str(excinfo.value							)							)
  
  					_test_prompt_error_raised_helper("<|startofprev|> test"				, "<|startofprev|>"							)
  					_test_prompt_error_raised_helper("test <|notimestamps|>"				, "<|notimestamps|>"							)
  					_test_prompt_error_raised_helper("test <|zh|> test <|transcribe|>"				, "<|zh|>"							)
  
  
style_context: 
  
  
  
  
  """simple docstring"""
  
  import random
  
  
  
  def   UpperCamelCase__     (		lowercase__  :     Union[str, Any]   ):
  
  		def is_sorted(lowercase__  :     int   ):
  				for i in range(len(lowercase__   ) - 1   ):
  						if collection[i] > collection[i + 1]:
  								return False
  				return True
  
  		while not is_sorted(lowercase__   ):
  				random.shuffle(lowercase__   )
  		return collection
  
  
  if __name__ == "__main__":
  							__A 		=			input("Enter numbers separated by a comma:\n").strip()
  							__A 		=			[int(item) for item in user_input.split(",")]
  							print(bogo_sort(unsorted))
  
  