
'''simple docstring'''







import json
import os
import tempfile
import unittest

from transformers.modelcard import ModelCard






class 				lowerCAmelCase__     (						unittest.TestCase  ):






					def 			_snake_case					(     self	):


											"""simple docstring"""





											lowercase_			:  Optional[Any]									= {
											    '''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 			_snake_case					(     self	):


											"""simple docstring"""





											lowercase_			:  Tuple									= ModelCard.from_dict(self.inputs_dict	)
											self.assertTrue(hasattr(__SCREAMING_SNAKE_CASE       ,							'''model_details'''	)	)
											self.assertTrue(hasattr(__SCREAMING_SNAKE_CASE       ,							'''intended_use'''	)	)
											self.assertTrue(hasattr(__SCREAMING_SNAKE_CASE       ,							'''factors'''	)	)
											self.assertTrue(hasattr(__SCREAMING_SNAKE_CASE       ,							'''metrics'''	)	)
											self.assertTrue(hasattr(__SCREAMING_SNAKE_CASE       ,							'''evaluation_data'''	)	)
											self.assertTrue(hasattr(__SCREAMING_SNAKE_CASE       ,							'''training_data'''	)	)
											self.assertTrue(hasattr(__SCREAMING_SNAKE_CASE       ,							'''quantitative_analyses'''	)	)
											self.assertTrue(hasattr(__SCREAMING_SNAKE_CASE       ,							'''ethical_considerations'''	)	)
											self.assertTrue(hasattr(__SCREAMING_SNAKE_CASE       ,							'''caveats_and_recommendations'''	)	)






					def 			_snake_case					(     self	):


											"""simple docstring"""





											lowercase_			:  List[Any]									= ModelCard.from_dict(self.inputs_dict	)
											lowercase_			:  Any									= json.loads(modelcard.to_json_string()	)
											for key, value in self.inputs_dict.items():
																	self.assertEqual(obj[key]       ,							__SCREAMING_SNAKE_CASE	)






					def 			_snake_case					(     self	):


											"""simple docstring"""





											lowercase_			:  Dict									= ModelCard.from_dict(self.inputs_dict	)

											with tempfile.TemporaryDirectory() as tmpdirname:
																	lowercase_			:  List[str]									= os.path.join(__SCREAMING_SNAKE_CASE       ,							'''modelcard.json'''	)
																	model_card_first.to_json_file(__SCREAMING_SNAKE_CASE	)
																	lowercase_			:  List[Any]									= ModelCard.from_json_file(__SCREAMING_SNAKE_CASE	)

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






					def 			_snake_case					(     self	):


											"""simple docstring"""





											lowercase_			:  Dict									= ModelCard.from_dict(self.inputs_dict	)

											with tempfile.TemporaryDirectory() as tmpdirname:
																	model_card_first.save_pretrained(__SCREAMING_SNAKE_CASE	)
																	lowercase_			:  Dict									= ModelCard.from_pretrained(__SCREAMING_SNAKE_CASE	)

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





'''simple docstring'''







def       snake_case_	(       __SCREAMING_SNAKE_CASE      :				int = 1000							):



						"""simple docstring"""





						lowercase_			:  List[Any]									= 0
						for i in range(__SCREAMING_SNAKE_CASE							):
												if i % 3 == 0 or i % 5 == 0:
																		result += i
						return result


if __name__ == "__main__":
							print(f"""{solution() = }""")



