





import json
import os
import tempfile
import unittest

from transformers.modelcard import ModelCard



class 				_UpperCamelCase       (						unittest.TestCase  ):

       def lowercase			(		self:			Optional[Any]		)							->			Optional[int]:




              """simple docstring"""


              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 lowercase			(		self:			Any		)							->			Dict:




              """simple docstring"""


              UpperCamelCase_ 							=	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 lowercase			(		self:			Optional[Any]		)							->			int:




              """simple docstring"""


              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]       , _SCREAMING_SNAKE_CASE		)

       def lowercase			(		self:			int		)							->			Tuple:




              """simple docstring"""


              UpperCamelCase_ 							=	ModelCard.from_dict(self.inputs_dict		)

              with tempfile.TemporaryDirectory() as tmpdirname:
                     UpperCamelCase_ 							=	os.path.join(_SCREAMING_SNAKE_CASE       , "modelcard.json"		)
                     model_card_first.to_json_file(_SCREAMING_SNAKE_CASE		)
                     UpperCamelCase_ 							=	ModelCard.from_json_file(_SCREAMING_SNAKE_CASE		)

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



       def lowercase			(		self:			Optional[int]		)							->			int:




              """simple docstring"""


              UpperCamelCase_ 							=	ModelCard.from_dict(self.inputs_dict		)

              with tempfile.TemporaryDirectory() as tmpdirname:
                     model_card_first.save_pretrained(_SCREAMING_SNAKE_CASE		)
                     UpperCamelCase_ 							=	ModelCard.from_pretrained(_SCREAMING_SNAKE_CASE		)

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







def 							__lowerCAmelCase			(UpperCAmelCase_		):
    return n * (2 * n - 1)
def 							__lowerCAmelCase			(UpperCAmelCase_		):
    a__  			=							(1 + 24 * n) ** 0.5
    return ((1 + root) / 6) % 1 == 0
def 							__lowerCAmelCase			(UpperCAmelCase_ = 144		):
    a__  			=							start
    a__  			=							hexagonal_num(UpperCAmelCase_		)
    while not is_pentagonal(UpperCAmelCase_		):
        n += 1
        a__  			=							hexagonal_num(UpperCAmelCase_		)
    return num


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






