




import torch
import torch.nn.functional as F

from diffusers import VQDiffusionScheduler

from .test_schedulers import SchedulerCommonTest






class 			A			(		_lowerCAmelCase		):
     """simple docstring"""

     _snake_case:	Union[str, Any]     =(VQDiffusionScheduler,)




     def  __snake_case   (    self  :   str	,  **A__  :   int			)				->       Optional[int]:
           lowerCamelCase__        =				{
               'num_vec_classes': 4_0_9_7,
               'num_train_timesteps': 1_0_0,
           }

           config.update(**A__			)
           return config




     def  __snake_case   (    self  :   List[Any]	,  A__  :   List[str]			)				->       Union[str, Any]:
           lowerCamelCase__        =				4
           lowerCamelCase__        =				8
           lowerCamelCase__        =				8

           lowerCamelCase__        =				torch.randint(0	,  A__	,  (batch_size, height * width)			)

           return sample




     @property
     def  __snake_case   (    self  :   int			)				->       Tuple:
           assert False




     def  __snake_case   (    self  :   Optional[int]	,  A__  :   Optional[int]			)				->       Any:
           def model(A__  :   Union[str, Any]	,  A__  :   Any	,  *A__  :   Optional[Any]			):
                 lowerCamelCase__  ,		lowerCamelCase__        =				sample.shape
                 lowerCamelCase__        =				torch.rand((batch_size, num_vec_classes - 1, num_latent_pixels)			)
                 lowerCamelCase__        =				F.log_softmax(logits.double()	,  dim=1			).float()
                 return return_value

           return model




     def  __snake_case   (    self  :   str			)				->       Tuple:
           for timesteps in [2, 5, 1_0_0, 1_0_0_0]:
                 self.check_over_configs(num_train_timesteps=A__			)




     def  __snake_case   (    self  :   Optional[int]			)				->       int:
           for num_vec_classes in [5, 1_0_0, 1_0_0_0, 4_0_0_0]:
                 self.check_over_configs(num_vec_classes=A__			)




     def  __snake_case   (    self  :   Optional[int]			)				->       Dict:
           for t in [0, 5_0, 9_9]:
                 self.check_over_forward(time_step=A__			)




     def  __snake_case   (    self  :   Optional[Any]			)				->       str:
           pass





def 			lowerCAmelCase_			(  lowerCamelCase:       int     ,				lowerCamelCase:       list[tuple[int, int, int]]						)					->			list[tuple[int, int, int]]:


      '''simple docstring'''




      lowerCamelCase__        =				sorted(lowerCamelCase     ,				key=lambda lowerCamelCase						: edge[2]						)

      lowerCamelCase__        =				list(range(lowerCamelCase						)						)

      def find_parent(lowerCamelCase:       int						):
            if i != parent[i]:
                  lowerCamelCase__        =				find_parent(parent[i]						)
            return parent[i]

      lowerCamelCase__        =				0
      lowerCamelCase__        =				[]

      for edge in edges:
            lowerCamelCase__        =				find_parent(edge[0]						)
            lowerCamelCase__        =				find_parent(edge[1]						)
            if parent_a != parent_b:
                  minimum_spanning_tree_cost += edge[2]
                  minimum_spanning_tree.append(lowerCamelCase						)
                  lowerCamelCase__        =				parent_b

      return minimum_spanning_tree


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

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

      kruskal(num_nodes, edges)