


"""simple docstring"""







import json
import os
import tempfile
import unittest

from transformers.modelcard import ModelCard






class 		_A    (    unittest.TestCase    ):







    """simple docstring"""




    def       __snake_case				(   self							:       List[Any]):
      a		:						List[str] 				=     {
          "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							:       str):
      a		:						str 				=     ModelCard.from_dict(self.inputs_dict)
      self.assertTrue(hasattr(__UpperCAmelCase							,					"model_details"))
      self.assertTrue(hasattr(__UpperCAmelCase							,					"intended_use"))
      self.assertTrue(hasattr(__UpperCAmelCase							,					"factors"))
      self.assertTrue(hasattr(__UpperCAmelCase							,					"metrics"))
      self.assertTrue(hasattr(__UpperCAmelCase							,					"evaluation_data"))
      self.assertTrue(hasattr(__UpperCAmelCase							,					"training_data"))
      self.assertTrue(hasattr(__UpperCAmelCase							,					"quantitative_analyses"))
      self.assertTrue(hasattr(__UpperCAmelCase							,					"ethical_considerations"))
      self.assertTrue(hasattr(__UpperCAmelCase							,					"caveats_and_recommendations"))






    def       __snake_case				(   self							:       Dict):
      a		:						Union[str, Any] 				=     ModelCard.from_dict(self.inputs_dict)
      a		:						Dict 				=     json.loads(modelcard.to_json_string())
      for key, value in self.inputs_dict.items():
        self.assertEqual(obj[key]							,					__UpperCAmelCase)






    def       __snake_case				(   self							:       Tuple):
      a		:						Any 				=     ModelCard.from_dict(self.inputs_dict)

      with tempfile.TemporaryDirectory() as tmpdirname:
        a		:						Tuple 				=     os.path.join(__UpperCAmelCase							,					"modelcard.json")
        model_card_first.to_json_file(__UpperCAmelCase)
        a		:						int 				=     ModelCard.from_json_file(__UpperCAmelCase)

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






    def       __snake_case				(   self							:       Optional[int]):
      a		:						str 				=     ModelCard.from_dict(self.inputs_dict)

      with tempfile.TemporaryDirectory() as tmpdirname:
        model_card_first.save_pretrained(__UpperCAmelCase)
        a		:						int 				=     ModelCard.from_pretrained(__UpperCAmelCase)

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










"""simple docstring"""







def 	lowercase     (							A_    ,  A_			)-> list[tuple[int, int, int]]:
  '''simple docstring'''







  a		:						Union[str, Any] 				=     sorted(A_    ,  key=lambda A_			: edge[2]			)

  a		:						List[Any] 				=     list(range(A_			)			)

  def find_parent(A_			):
    if i != parent[i]:
      a		:						Dict 				=     find_parent(parent[i]			)
    return parent[i]

  a		:						Optional[Any] 				=     0
  a		:						Optional[int] 				=     []

  for edge in edges:
    a		:						List[str] 				=     find_parent(edge[0]			)
    a		:						int 				=     find_parent(edge[1]			)
    if parent_a != parent_b:
      minimum_spanning_tree_cost += edge[2]
      minimum_spanning_tree.append(A_			)
      a		:						Tuple 				=     parent_b

  return minimum_spanning_tree


if __name__ == "__main__":  # pragma: no cover
 __lowercase   ,				__lowercase          = list(map(int, input().strip().split()))
 __lowercase          = []

 for _ in range(num_edges):
  __lowercase   ,				__lowercase   ,				__lowercase          = (int(x) for x in input().strip().split())
  edges.append((nodea, nodea, cost))

 kruskal(num_nodes, edges)






