


'''simple docstring'''




from collections import defaultdict

from graphs.minimum_spanning_tree_prims import prisms_algorithm as mst





def   _a		()			->			List[Any]:






     """simple docstring"""
     __snake_case      ,       __snake_case           =						9, 1_4  # noqa: F841
     __snake_case           =						[
         [0, 1, 4],
         [0, 7, 8],
         [1, 2, 8],
         [7, 8, 7],
         [7, 6, 1],
         [2, 8, 2],
         [8, 6, 6],
         [2, 3, 7],
         [2, 5, 4],
         [6, 5, 2],
         [3, 5, 1_4],
         [3, 4, 9],
         [5, 4, 1_0],
         [1, 7, 1_1],
     ]

     __snake_case           =						defaultdict(__snake_case						)
     for nodea, nodea, cost in edges:
          adjancency[nodea].append([nodea, cost]						)
          adjancency[nodea].append([nodea, cost]						)

     __snake_case           =						mst(__snake_case						)

     __snake_case           =						[
         [7, 6, 1],
         [2, 8, 2],
         [6, 5, 2],
         [0, 1, 4],
         [2, 5, 4],
         [2, 3, 7],
         [0, 7, 8],
         [3, 4, 9],
     ]

     for answer in expected:
          __snake_case           =						tuple(answer[:2]						)
          __snake_case           =						tuple(edge[::-1]						)
          assert edge in result or reverse in result





'''simple docstring'''






_UpperCAmelCase    :     Any         =       '''0.21.0'''

from .accelerator import Accelerator
from .big_modeling import (
    cpu_offload,
    cpu_offload_with_hook,
    disk_offload,
    dispatch_model,
    init_empty_weights,
    init_on_device,
    load_checkpoint_and_dispatch,
)
from .data_loader import skip_first_batches
from .launchers import debug_launcher, notebook_launcher
from .state import PartialState
from .utils import (
    DeepSpeedPlugin,
    DistributedDataParallelKwargs,
    DistributedType,
    FullyShardedDataParallelPlugin,
    GradScalerKwargs,
    InitProcessGroupKwargs,
    find_executable_batch_size,
    infer_auto_device_map,
    is_rich_available,
    load_checkpoint_in_model,
    synchronize_rng_states,
)


if is_rich_available():
   from .utils import rich



