


from dataclasses import dataclass
from enum import Enum
from typing import List, Optional, Union

import numpy as np
import PIL
from PIL import Image

from ...utils import BaseOutput, is_torch_available, is_transformers_available

@dataclass
class 			lowerCamelCase_					(    _SCREAMING_SNAKE_CASE    ):
							_lowerCamelCase				: Union[str, Any]       =					{
							    """sld_warmup_steps""": 15,
							    """sld_guidance_scale""": 20,
							    """sld_threshold""": 0.0,
							    """sld_momentum_scale""": 0.0,
							    """sld_mom_beta""": 0.0,
							}
							_lowerCamelCase				: Tuple       =					{
							    """sld_warmup_steps""": 10,
							    """sld_guidance_scale""": 1000,
							    """sld_threshold""": 0.01,
							    """sld_momentum_scale""": 0.3,
							    """sld_mom_beta""": 0.4,
							}
							_lowerCamelCase				: str       =					{
							    """sld_warmup_steps""": 7,
							    """sld_guidance_scale""": 2000,
							    """sld_threshold""": 0.025,
							    """sld_momentum_scale""": 0.5,
							    """sld_mom_beta""": 0.7,
							}
							_lowerCamelCase				: Any       =					{
							    """sld_warmup_steps""": 0,
							    """sld_guidance_scale""": 5000,
							    """sld_threshold""": 1.0,
							    """sld_momentum_scale""": 0.5,
							    """sld_mom_beta""": 0.7,
							}







@dataclass
class 			lowerCamelCase_					(    _SCREAMING_SNAKE_CASE    ):
							_lowerCamelCase				: Union[List[PIL.Image.Image], np.ndarray]
							_lowerCamelCase				: Optional[List[bool]]
							_lowerCamelCase				: Optional[Union[List[PIL.Image.Image], np.ndarray]]
							_lowerCamelCase				: Optional[str]


if is_transformers_available() and is_torch_available():
			from .pipeline_stable_diffusion_safe import StableDiffusionPipelineSafe
			from .safety_checker import SafeStableDiffusionSafetyChecker



def 			__SCREAMING_SNAKE_CASE		(		UpperCamelCase		:      int     ,					UpperCamelCase		:      list[tuple[int, int, int]]	)     ->	list[tuple[int, int, int]]:



	"""simple docstring"""






	a_     			=   sorted(UpperCamelCase     ,					key=lambda UpperCamelCase	: edge[2]	)

	a_     			=   list(range(UpperCamelCase	)	)

	def find_parent(UpperCamelCase		:      Any	):
		if i != parent[i]:
			a_     			=   find_parent(parent[i]	)
		return parent[i]

	a_     			=   0
	a_     			=   []

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

	return minimum_spanning_tree


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

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

			kruskal(num_nodes, edges)