






"""simple docstring"""






from ....configuration_utils import PretrainedConfig
from ....utils import logging


UpperCAmelCase_     :				Dict         =				logging.get_logger(__name__)

UpperCAmelCase_     :				Tuple         =				{
    """speechbrain/m-ctc-t-large""": """https://huggingface.co/speechbrain/m-ctc-t-large/resolve/main/config.json""",
    # See all M-CTC-T models at https://huggingface.co/models?filter=mctct
}




class 							lowerCAmelCase__       (    lowercase__				):






      '''simple docstring'''

      __UpperCamelCase							=						"mctct"
      def __init__(		self  :						Any		,			lowercase_  :						str=8065		,			lowercase_  :						str=1536		,			lowercase_  :						int=36		,			lowercase_  :						Union[str, Any]=6144		,			lowercase_  :						str=4		,			lowercase_  :						str=384		,			lowercase_  :						List[str]=920		,			lowercase_  :						Dict=1e-5		,			lowercase_  :						Any=0.3		,			lowercase_  :						int="relu"		,			lowercase_  :						Dict=0.02		,			lowercase_  :						Optional[Any]=0.3		,			lowercase_  :						Dict=0.3		,			lowercase_  :						Any=1		,			lowercase_  :						Any=0		,			lowercase_  :						List[str]=2		,			lowercase_  :						List[Any]=1		,			lowercase_  :						Optional[Any]=0.3		,			lowercase_  :						int=1		,			lowercase_  :						Dict=(7,)		,			lowercase_  :						Any=(3,)		,			lowercase_  :						Union[str, Any]=80		,			lowercase_  :						Optional[Any]=1		,			lowercase_  :						Dict=None		,			lowercase_  :						List[str]="sum"		,			lowercase_  :						Optional[Any]=False		,			**lowercase_  :						Dict		,			):




          '''simple docstring'''


          super().__init__(**UpperCAmelCase__		,			pad_token_id=UpperCAmelCase__		,			bos_token_id=UpperCAmelCase__		,			eos_token_id=UpperCAmelCase__)
          SCREAMING_SNAKE_CASE_   :						str							=	vocab_size
          SCREAMING_SNAKE_CASE_   :						int							=	hidden_size
          SCREAMING_SNAKE_CASE_   :						Union[str, Any]							=	num_hidden_layers
          SCREAMING_SNAKE_CASE_   :						Optional[Any]							=	intermediate_size
          SCREAMING_SNAKE_CASE_   :						Tuple							=	num_attention_heads
          SCREAMING_SNAKE_CASE_   :						Tuple							=	attention_head_dim
          SCREAMING_SNAKE_CASE_   :						str							=	max_position_embeddings
          SCREAMING_SNAKE_CASE_   :						str							=	layer_norm_eps
          SCREAMING_SNAKE_CASE_   :						int							=	layerdrop
          SCREAMING_SNAKE_CASE_   :						Dict							=	hidden_act
          SCREAMING_SNAKE_CASE_   :						List[str]							=	initializer_range
          SCREAMING_SNAKE_CASE_   :						Optional[Any]							=	hidden_dropout_prob
          SCREAMING_SNAKE_CASE_   :						Dict							=	attention_probs_dropout_prob
          SCREAMING_SNAKE_CASE_   :						Dict							=	pad_token_id
          SCREAMING_SNAKE_CASE_   :						Union[str, Any]							=	bos_token_id
          SCREAMING_SNAKE_CASE_   :						Optional[int]							=	eos_token_id
          SCREAMING_SNAKE_CASE_   :						Optional[Any]							=	conv_glu_dim
          SCREAMING_SNAKE_CASE_   :						Any							=	conv_dropout
          SCREAMING_SNAKE_CASE_   :						int							=	num_conv_layers
          SCREAMING_SNAKE_CASE_   :						Optional[Any]							=	input_feat_per_channel
          SCREAMING_SNAKE_CASE_   :						Optional[int]							=	input_channels
          SCREAMING_SNAKE_CASE_   :						List[str]							=	conv_channels
          SCREAMING_SNAKE_CASE_   :						Optional[Any]							=	ctc_loss_reduction
          SCREAMING_SNAKE_CASE_   :						Optional[Any]							=	ctc_zero_infinity

          # prevents config testing fail with exporting to json
          SCREAMING_SNAKE_CASE_   :						Optional[int]							=	list(UpperCAmelCase__)
          SCREAMING_SNAKE_CASE_   :						Optional[Any]							=	list(UpperCAmelCase__)

          if len(self.conv_kernel) != self.num_conv_layers:
              raise ValueError(
                  '''Configuration for convolutional module is incorrect. '''
                  '''It is required that `len(config.conv_kernel)` == `config.num_conv_layers` '''
                  F'but is `len(config.conv_kernel) = {len(self.conv_kernel)}`, '
                  F'`config.num_conv_layers = {self.num_conv_layers}`.')










"""simple docstring"""






from collections import defaultdict

from graphs.minimum_spanning_tree_prims import prisms_algorithm as mst



def       _A    ()				-> Union[str, Any]:
    """simple docstring"""






    SCREAMING_SNAKE_CASE_		,    SCREAMING_SNAKE_CASE_   :						Tuple							=	9, 14  # noqa: F841
    SCREAMING_SNAKE_CASE_   :						Tuple							=	[
        [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, 14],
        [3, 4, 9],
        [5, 4, 10],
        [1, 7, 11],
    ]

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

    SCREAMING_SNAKE_CASE_   :						Any							=	mst(__a							)

    SCREAMING_SNAKE_CASE_   :						Optional[int]							=	[
        [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:
        SCREAMING_SNAKE_CASE_   :						Dict							=	tuple(answer[:2]							)
        SCREAMING_SNAKE_CASE_   :						Optional[int]							=	tuple(edge[::-1]							)
        assert edge in result or reverse in result


