




'''simple docstring'''





def UpperCAmelCase    (       UpperCAmelCase_   ,	UpperCAmelCase_ = 2						):
    return round((float(UpperCAmelCase_						) * 9 / 5) + 32   ,	UpperCAmelCase_						)





def UpperCAmelCase    (       UpperCAmelCase_   ,	UpperCAmelCase_ = 2						):
    return round(float(UpperCAmelCase_						) + 273.15   ,	UpperCAmelCase_						)





def UpperCAmelCase    (       UpperCAmelCase_   ,	UpperCAmelCase_ = 2						):
    return round((float(UpperCAmelCase_						) * 9 / 5) + 491.67   ,	UpperCAmelCase_						)





def UpperCAmelCase    (       UpperCAmelCase_   ,	UpperCAmelCase_ = 2						):
    return round((float(UpperCAmelCase_						) - 32) * 5 / 9   ,	UpperCAmelCase_						)





def UpperCAmelCase    (       UpperCAmelCase_   ,	UpperCAmelCase_ = 2						):
    return round(((float(UpperCAmelCase_						) - 32) * 5 / 9) + 273.15   ,	UpperCAmelCase_						)





def UpperCAmelCase    (       UpperCAmelCase_   ,	UpperCAmelCase_ = 2						):
    return round(float(UpperCAmelCase_						) + 459.67   ,	UpperCAmelCase_						)





def UpperCAmelCase    (       UpperCAmelCase_   ,	UpperCAmelCase_ = 2						):
    return round(float(UpperCAmelCase_						) - 273.15   ,	UpperCAmelCase_						)





def UpperCAmelCase    (       UpperCAmelCase_   ,	UpperCAmelCase_ = 2						):
    return round(((float(UpperCAmelCase_						) - 273.15) * 9 / 5) + 32   ,	UpperCAmelCase_						)





def UpperCAmelCase    (       UpperCAmelCase_   ,	UpperCAmelCase_ = 2						):
    return round((float(UpperCAmelCase_						) * 9 / 5)   ,	UpperCAmelCase_						)





def UpperCAmelCase    (       UpperCAmelCase_   ,	UpperCAmelCase_ = 2						):
    return round((float(UpperCAmelCase_						) - 491.67) * 5 / 9   ,	UpperCAmelCase_						)





def UpperCAmelCase    (       UpperCAmelCase_   ,	UpperCAmelCase_ = 2						):
    return round(float(UpperCAmelCase_						) - 459.67   ,	UpperCAmelCase_						)





def UpperCAmelCase    (       UpperCAmelCase_   ,	UpperCAmelCase_ = 2						):
    return round((float(UpperCAmelCase_						) * 5 / 9)   ,	UpperCAmelCase_						)





def UpperCAmelCase    (       UpperCAmelCase_   ,	UpperCAmelCase_ = 2						):
    return round((float(UpperCAmelCase_						) * 1.25 + 273.15)   ,	UpperCAmelCase_						)





def UpperCAmelCase    (       UpperCAmelCase_   ,	UpperCAmelCase_ = 2						):
    return round((float(UpperCAmelCase_						) * 2.25 + 32)   ,	UpperCAmelCase_						)





def UpperCAmelCase    (       UpperCAmelCase_   ,	UpperCAmelCase_ = 2						):
    return round((float(UpperCAmelCase_						) * 1.25)   ,	UpperCAmelCase_						)





def UpperCAmelCase    (       UpperCAmelCase_   ,	UpperCAmelCase_ = 2						):
    return round((float(UpperCAmelCase_						) * 2.25 + 32 + 459.67)   ,	UpperCAmelCase_						)


if __name__ == "__main__":
  import doctest

  doctest.testmod()





"""simple docstring"""




import inspect
import json
import os
import tempfile
import unittest

from transformers.models.speech_to_text_a import SpeechaTextaTokenizer
from transformers.models.speech_to_text_a.tokenization_speech_to_text_a import VOCAB_FILES_NAMES

from ...test_tokenization_common import TokenizerTesterMixin





class      __UpperCamelCase					(  _A	,						unittest.TestCase		):
		SCREAMING_SNAKE_CASE														=       SpeechaTextaTokenizer
		SCREAMING_SNAKE_CASE														=       False


		def    SCREAMING_SNAKE_CASE__  (self					:						Tuple):
							super().setUp()

							A     =   "<s> <pad> </s> <unk> here@@ a couple of@@ words for the he@@ re@@ vocab".split(" ")
							A     =   ["he re</w> 123", "here a 1456"]
							A     =   dict(zip(__SCREAMING_SNAKE_CASE	,	range(len(__SCREAMING_SNAKE_CASE))))

							A     =   {"pad_token": "<pad>", "unk_token": "<unk>", "bos_token": "<s>", "eos_token": "</s>"}

							A     =   tempfile.mkdtemp()
							A     =   os.path.join(self.tmpdirname	,	VOCAB_FILES_NAMES["vocab_file"])
							A     =   os.path.join(self.tmpdirname	,	VOCAB_FILES_NAMES["merges_file"])

							with open(self.vocab_file	,	"w"	,	encoding="utf-8") as fp:
												fp.write(json.dumps(__SCREAMING_SNAKE_CASE) + "\n")

							with open(self.merges_file	,	"w") as fp:
												fp.write("\n".join(__SCREAMING_SNAKE_CASE))


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

							self.assertEqual(vocab_keys[0]	,	"<s>")
							self.assertEqual(vocab_keys[1]	,	"<pad>")
							self.assertEqual(vocab_keys[-1]	,	"vocab")
							self.assertEqual(len(__SCREAMING_SNAKE_CASE)	,	1_4)


		def    SCREAMING_SNAKE_CASE__  (self					:						Any):
							self.assertEqual(self.get_tokenizer().vocab_size	,	1_4)


		def    SCREAMING_SNAKE_CASE__  (self					:						Union[str, Any]):
							A     =   SpeechaTextaTokenizer.from_pretrained(self.tmpdirname)

							# make sure @@ is correctly concatenated
							A     =   [4, 6, 8, 7, 1_0]  # ["here@@", "couple", "words", "of@@", "the"]
							A     =   tokenizer.decode(__SCREAMING_SNAKE_CASE)

							self.assertTrue(output_string == "herecouple words ofthe")


		def    SCREAMING_SNAKE_CASE__  (self					:						str):
							A     =   SpeechaTextaTokenizer.from_pretrained(self.tmpdirname)

							with tempfile.TemporaryDirectory() as tmp_dirname:
												tokenizer.save_pretrained(__SCREAMING_SNAKE_CASE)
												os.remove(os.path.join(__SCREAMING_SNAKE_CASE	,	"merges.txt"))

												# load tokenizer without merges file should not throw an error
												A     =   SpeechaTextaTokenizer.from_pretrained(__SCREAMING_SNAKE_CASE)

							with tempfile.TemporaryDirectory() as tmp_dirname:
												# save tokenizer and load again
												tokenizer.save_pretrained(__SCREAMING_SNAKE_CASE)
												A     =   SpeechaTextaTokenizer.from_pretrained(__SCREAMING_SNAKE_CASE)

							self.assertIsNotNone(__SCREAMING_SNAKE_CASE)


		def    SCREAMING_SNAKE_CASE__  (self					:						Tuple):
							if not self.test_slow_tokenizer:
												return

							A     =   inspect.signature(self.tokenizer_class.__init__)
							A     =   self.get_tokenizer()

							for parameter_name, parameter in signature.parameters.items():
												if parameter.default != inspect.Parameter.empty and parameter_name != "merges_file":
																	self.assertIn(__SCREAMING_SNAKE_CASE	,	tokenizer.init_kwargs)





