


"""simple docstring"""






from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


_lowerCAmelCase							:    Any					   =	{
    '''configuration_whisper''': ['''WHISPER_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''WhisperConfig''', '''WhisperOnnxConfig'''],
    '''feature_extraction_whisper''': ['''WhisperFeatureExtractor'''],
    '''processing_whisper''': ['''WhisperProcessor'''],
    '''tokenization_whisper''': ['''WhisperTokenizer'''],
}

try:
  if not is_tokenizers_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  _lowerCAmelCase							:    Optional[int]					   =	['''WhisperTokenizerFast''']

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  _lowerCAmelCase							:    Any					   =	[
      '''WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST''',
      '''WhisperForConditionalGeneration''',
      '''WhisperModel''',
      '''WhisperPreTrainedModel''',
      '''WhisperForAudioClassification''',
  ]

try:
  if not is_tf_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  _lowerCAmelCase							:    Any					   =	[
      '''TF_WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST''',
      '''TFWhisperForConditionalGeneration''',
      '''TFWhisperModel''',
      '''TFWhisperPreTrainedModel''',
  ]

try:
  if not is_flax_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  _lowerCAmelCase							:    List[str]					   =	[
      '''FlaxWhisperForConditionalGeneration''',
      '''FlaxWhisperModel''',
      '''FlaxWhisperPreTrainedModel''',
      '''FlaxWhisperForAudioClassification''',
  ]


if TYPE_CHECKING:
  from .configuration_whisper import WHISPER_PRETRAINED_CONFIG_ARCHIVE_MAP, WhisperConfig, WhisperOnnxConfig
  from .feature_extraction_whisper import WhisperFeatureExtractor
  from .processing_whisper import WhisperProcessor
  from .tokenization_whisper import WhisperTokenizer

  try:
    if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .tokenization_whisper_fast import WhisperTokenizerFast

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_whisper import (
        WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST,
        WhisperForAudioClassification,
        WhisperForConditionalGeneration,
        WhisperModel,
        WhisperPreTrainedModel,
    )

  try:
    if not is_tf_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_tf_whisper import (
        TF_WHISPER_PRETRAINED_MODEL_ARCHIVE_LIST,
        TFWhisperForConditionalGeneration,
        TFWhisperModel,
        TFWhisperPreTrainedModel,
    )

  try:
    if not is_flax_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_flax_whisper import (
        FlaxWhisperForAudioClassification,
        FlaxWhisperForConditionalGeneration,
        FlaxWhisperModel,
        FlaxWhisperPreTrainedModel,
    )

else:
  import sys

  _lowerCAmelCase							:    List[Any]					   =	_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)






"""simple docstring"""
from __future__ import annotations

import os
from collections.abc import Mapping

__UpperCamelCase     :						Optional[Any]						       =  tuple[int, int]







class       a							:



 def __init__(     self				,       _snake_case				,       _snake_case     ):







  """simple docstring"""






  lowerCAmelCase    				= vertices
  lowerCAmelCase    				= {
      (min(_snake_case     ), max(_snake_case     )): weight for edge, weight in edges.items()
  }



 def    UpperCamelCase__  (     self				,       _snake_case				,       _snake_case     ):







  """simple docstring"""






  self.vertices.add(edge[0]     )
  self.vertices.add(edge[1]     )
  lowerCAmelCase    				= weight



 def    UpperCamelCase__  (     self     ):







  """simple docstring"""






  lowerCAmelCase    				= Graph({min(self.vertices     )}				,       {}     )
  lowerCAmelCase    				= 42
  lowerCAmelCase    				= 42
  lowerCAmelCase    				= 42
  lowerCAmelCase    				= 42

  while len(subgraph.vertices     ) < len(self.vertices     ):
   lowerCAmelCase    				= max(self.edges.values()     ) + 1
   for edge, weight in self.edges.items():
    if (edge[0] in subgraph.vertices) ^ (edge[1] in subgraph.vertices):
     if weight < min_weight:
      lowerCAmelCase    				= edge
      lowerCAmelCase    				= weight

   subgraph.add_edge(_snake_case				,       _snake_case     )

  return subgraph


def 		_SCREAMING_SNAKE_CASE			(_UpperCAmelCase					:    str = "p107_network.txt"			):
 lowerCAmelCase    				= os.path.abspath(os.path.dirname(_UpperCAmelCase			)			)
 lowerCAmelCase    				= os.path.join(_UpperCAmelCase  ,     _UpperCAmelCase			)
 lowerCAmelCase    				= {}
 lowerCAmelCase    				= 42
 lowerCAmelCase    				= 42
 lowerCAmelCase    				= 42

 with open(_UpperCAmelCase			) as f:
  lowerCAmelCase    				= f.read().strip().split('\n'			)

 lowerCAmelCase    				= [line.split(','			) for line in data]

 for edgea in range(1  ,     len(_UpperCAmelCase			)			):
  for edgea in range(_UpperCAmelCase			):
   if adjaceny_matrix[edgea][edgea] != "-":
    lowerCAmelCase    				= int(adjaceny_matrix[edgea][edgea]			)

 lowerCAmelCase    				= Graph(set(range(len(_UpperCAmelCase			)			)			)  ,     _UpperCAmelCase			)

 lowerCAmelCase    				= graph.prims_algorithm()

 lowerCAmelCase    				= sum(graph.edges.values()			)
 lowerCAmelCase    				= sum(subgraph.edges.values()			)

 return initial_total - optimal_total


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





