


"""simple docstring"""







import json
import os
import tempfile
import unittest

from transformers.modelcard import ModelCard
class 				lowerCamelCase							(      unittest.TestCase			):


							"""simple docstring"""






							def        lowerCAmelCase  (    self			:  int					):
													UpperCAmelCase__												=     {
													    '''model_details''': {
													        '''Organization''': '''testing''',
													        '''Model date''': '''today''',
													        '''Model version''': '''v2.1, Developed by Test Corp in 2019.''',
													        '''Architecture''': '''Convolutional Neural Network.''',
													    },
													    '''metrics''': '''BLEU and ROUGE-1''',
													    '''evaluation_data''': {
													        '''Datasets''': {'''BLEU''': '''My-great-dataset-v1''', '''ROUGE-1''': '''My-short-dataset-v2.1'''},
													        '''Preprocessing''': '''See details on https://arxiv.org/pdf/1810.03993.pdf''',
													    },
													    '''training_data''': {
													        '''Dataset''': '''English Wikipedia dump dated 2018-12-01''',
													        '''Preprocessing''': (
													            '''Using SentencePiece vocabulary of size 52k tokens. See details on'''
													            ''' https://arxiv.org/pdf/1810.03993.pdf'''
													        ),
													    },
													    '''quantitative_analyses''': {'''BLEU''': 55.1, '''ROUGE-1''': 76},
													}






							def        lowerCAmelCase  (    self			:  Any					):
													UpperCAmelCase__												=     ModelCard.from_dict(self.inputs_dict					)
													self.assertTrue(hasattr(lowerCamelCase_		,			'''model_details'''					)					)
													self.assertTrue(hasattr(lowerCamelCase_		,			'''intended_use'''					)					)
													self.assertTrue(hasattr(lowerCamelCase_		,			'''factors'''					)					)
													self.assertTrue(hasattr(lowerCamelCase_		,			'''metrics'''					)					)
													self.assertTrue(hasattr(lowerCamelCase_		,			'''evaluation_data'''					)					)
													self.assertTrue(hasattr(lowerCamelCase_		,			'''training_data'''					)					)
													self.assertTrue(hasattr(lowerCamelCase_		,			'''quantitative_analyses'''					)					)
													self.assertTrue(hasattr(lowerCamelCase_		,			'''ethical_considerations'''					)					)
													self.assertTrue(hasattr(lowerCamelCase_		,			'''caveats_and_recommendations'''					)					)






							def        lowerCAmelCase  (    self			:  Any					):
													UpperCAmelCase__												=     ModelCard.from_dict(self.inputs_dict					)
													UpperCAmelCase__												=     json.loads(modelcard.to_json_string()					)
													for key, value in self.inputs_dict.items():
																			self.assertEqual(obj[key]		,			lowerCamelCase_					)






							def        lowerCAmelCase  (    self			:  str					):
													UpperCAmelCase__												=     ModelCard.from_dict(self.inputs_dict					)

													with tempfile.TemporaryDirectory() as tmpdirname:
																			UpperCAmelCase__												=     os.path.join(lowerCamelCase_		,			'''modelcard.json'''					)
																			model_card_first.to_json_file(lowerCamelCase_					)
																			UpperCAmelCase__												=     ModelCard.from_json_file(lowerCamelCase_					)

													self.assertEqual(model_card_second.to_dict()		,			model_card_first.to_dict()					)






							def        lowerCAmelCase  (    self			:  Optional[Any]					):
													UpperCAmelCase__												=     ModelCard.from_dict(self.inputs_dict					)

													with tempfile.TemporaryDirectory() as tmpdirname:
																			model_card_first.save_pretrained(lowerCamelCase_					)
																			UpperCAmelCase__												=     ModelCard.from_pretrained(lowerCamelCase_					)

													self.assertEqual(model_card_second.to_dict()		,			model_card_first.to_dict()					)



"""simple docstring"""







def        a__			(							_UpperCamelCase						,      _UpperCamelCase = 2			):





						"""simple docstring"""

						return round((float(_UpperCamelCase			) * 9 / 5) + 32						,      _UpperCamelCase			)






def        a__			(							_UpperCamelCase						,      _UpperCamelCase = 2			):





						"""simple docstring"""

						return round(float(_UpperCamelCase			) + 273.15						,      _UpperCamelCase			)






def        a__			(							_UpperCamelCase						,      _UpperCamelCase = 2			):





						"""simple docstring"""

						return round((float(_UpperCamelCase			) * 9 / 5) + 491.67						,      _UpperCamelCase			)






def        a__			(							_UpperCamelCase						,      _UpperCamelCase = 2			):





						"""simple docstring"""

						return round((float(_UpperCamelCase			) - 32) * 5 / 9						,      _UpperCamelCase			)






def        a__			(							_UpperCamelCase						,      _UpperCamelCase = 2			):





						"""simple docstring"""

						return round(((float(_UpperCamelCase			) - 32) * 5 / 9) + 273.15						,      _UpperCamelCase			)






def        a__			(							_UpperCamelCase						,      _UpperCamelCase = 2			):





						"""simple docstring"""

						return round(float(_UpperCamelCase			) + 459.67						,      _UpperCamelCase			)






def        a__			(							_UpperCamelCase						,      _UpperCamelCase = 2			):





						"""simple docstring"""

						return round(float(_UpperCamelCase			) - 273.15						,      _UpperCamelCase			)






def        a__			(							_UpperCamelCase						,      _UpperCamelCase = 2			):





						"""simple docstring"""

						return round(((float(_UpperCamelCase			) - 273.15) * 9 / 5) + 32						,      _UpperCamelCase			)






def        a__			(							_UpperCamelCase						,      _UpperCamelCase = 2			):





						"""simple docstring"""

						return round((float(_UpperCamelCase			) * 9 / 5)						,      _UpperCamelCase			)






def        a__			(							_UpperCamelCase						,      _UpperCamelCase = 2			):





						"""simple docstring"""

						return round((float(_UpperCamelCase			) - 491.67) * 5 / 9						,      _UpperCamelCase			)






def        a__			(							_UpperCamelCase						,      _UpperCamelCase = 2			):





						"""simple docstring"""

						return round(float(_UpperCamelCase			) - 459.67						,      _UpperCamelCase			)






def        a__			(							_UpperCamelCase						,      _UpperCamelCase = 2			):





						"""simple docstring"""

						return round((float(_UpperCamelCase			) * 5 / 9)						,      _UpperCamelCase			)






def        a__			(							_UpperCamelCase						,      _UpperCamelCase = 2			):





						"""simple docstring"""

						return round((float(_UpperCamelCase			) * 1.25 + 273.15)						,      _UpperCamelCase			)






def        a__			(							_UpperCamelCase						,      _UpperCamelCase = 2			):





						"""simple docstring"""

						return round((float(_UpperCamelCase			) * 2.25 + 32)						,      _UpperCamelCase			)






def        a__			(							_UpperCamelCase						,      _UpperCamelCase = 2			):





						"""simple docstring"""

						return round((float(_UpperCamelCase			) * 1.25)						,      _UpperCamelCase			)






def        a__			(							_UpperCamelCase						,      _UpperCamelCase = 2			):





						"""simple docstring"""

						return round((float(_UpperCamelCase			) * 2.25 + 32 + 459.67)						,      _UpperCamelCase			)


if __name__ == "__main__":
						import doctest

						doctest.testmod()