





from queue import PriorityQueue
from typing import Any

import numpy as np


def     lowerCamelCase_	(      lowerCAmelCase:	dict    ,							lowerCAmelCase:	str    ,							lowerCAmelCase:	set    ,							lowerCAmelCase:	set    ,							lowerCAmelCase:	dict    ,							lowerCAmelCase:	dict    ,							lowerCAmelCase:	PriorityQueue    ,							lowerCAmelCase:	dict    ,							lowerCAmelCase:	float | int    ,							)->		float | int:
  for nxt, d in graph[v]:
    if nxt in visited_forward:
      continue
    _snake_case   :				Union[str, Any]														=	cst_fwd.get(lowerCAmelCase    ,							np.inf				)
    _snake_case   :				Tuple														=	cst_fwd[v] + d
    if new_cost_f < old_cost_f:
      queue.put((new_cost_f, nxt)				)
      _snake_case   :				Dict														=	new_cost_f
      _snake_case   :				List[str]														=	v
    if nxt in visited_backward:
      if cst_fwd[v] + d + cst_bwd[nxt] < shortest_distance:
        _snake_case   :				Optional[int]														=	cst_fwd[v] + d + cst_bwd[nxt]
  return shortest_distance


def     lowerCamelCase_	(      lowerCAmelCase:	str    ,							lowerCAmelCase:	str    ,							lowerCAmelCase:	dict    ,							lowerCAmelCase:	dict				)->		int:
  _snake_case   :				Optional[Any]														=	-1

  _snake_case   :				Any														=	set()
  _snake_case   :				Union[str, Any]														=	set()
  _snake_case   :				List[Any]														=	{source: 0}
  _snake_case   :				Tuple														=	{destination: 0}
  _snake_case   :				str														=	{source: None}
  _snake_case   :				Optional[Any]														=	{destination: None}
  _snake_case   :				PriorityQueue[Any]														=	PriorityQueue()
  _snake_case   :				PriorityQueue[Any]														=	PriorityQueue()

  _snake_case   :				List[Any]														=	np.inf

  queue_forward.put((0, source)				)
  queue_backward.put((0, destination)				)

  if source == destination:
    return 0

  while not queue_forward.empty() and not queue_backward.empty():
    _snake_case							,					_snake_case   :				Optional[int]														=	queue_forward.get()
    visited_forward.add(lowerCAmelCase				)

    _snake_case							,					_snake_case   :				Dict														=	queue_backward.get()
    visited_backward.add(lowerCAmelCase				)

    _snake_case   :				Any														=	pass_and_relaxation(
        lowerCAmelCase    ,							lowerCAmelCase    ,							lowerCAmelCase    ,							lowerCAmelCase    ,							lowerCAmelCase    ,							lowerCAmelCase    ,							lowerCAmelCase    ,							lowerCAmelCase    ,							lowerCAmelCase    ,							)

    _snake_case   :				Optional[Any]														=	pass_and_relaxation(
        lowerCAmelCase    ,							lowerCAmelCase    ,							lowerCAmelCase    ,							lowerCAmelCase    ,							lowerCAmelCase    ,							lowerCAmelCase    ,							lowerCAmelCase    ,							lowerCAmelCase    ,							lowerCAmelCase    ,							)

    if cst_fwd[v_fwd] + cst_bwd[v_bwd] >= shortest_distance:
      break

  if shortest_distance != np.inf:
    _snake_case   :				Tuple														=	shortest_distance
  return shortest_path_distance


lowerCAmelCase_						   =    {
    """B""": [["""C""", 1]],
    """C""": [["""D""", 1]],
    """D""": [["""F""", 1]],
    """E""": [["""B""", 1], ["""G""", 2]],
    """F""": [],
    """G""": [["""F""", 1]],
}
lowerCAmelCase_						   =    {
    """B""": [["""E""", 1]],
    """C""": [["""B""", 1]],
    """D""": [["""C""", 1]],
    """F""": [["""D""", 1], ["""G""", 1]],
    """E""": [[None, np.inf]],
    """G""": [["""E""", 2]],
}

if __name__ == "__main__":
      import doctest

      doctest.testmod()











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


lowerCAmelCase_						   =    logging.get_logger(__name__)

lowerCAmelCase_						   =    {
    """MIT/ast-finetuned-audioset-10-10-0.4593""": (
        """https://huggingface.co/MIT/ast-finetuned-audioset-10-10-0.4593/resolve/main/config.json"""
    ),
}



class        _lowerCAmelCase    (			UpperCAmelCase_							):


  '''simple docstring'''
  a_							:       Tuple      					="""audio-spectrogram-transformer"""







  def __init__(      self      :					List[Any]      ,				UpperCamelCase      :					Union[str, Any]=7_68      ,				UpperCamelCase      :					int=12      ,				UpperCamelCase      :					str=12      ,				UpperCamelCase      :					Tuple=30_72      ,				UpperCamelCase      :					Optional[Any]="gelu"      ,				UpperCamelCase      :					Any=0.0      ,				UpperCamelCase      :					Dict=0.0      ,				UpperCamelCase      :					List[Any]=0.02      ,				UpperCamelCase      :					Dict=1e-1_2      ,				UpperCamelCase      :					str=16      ,				UpperCamelCase      :					List[Any]=True      ,				UpperCamelCase      :					Any=10      ,				UpperCamelCase      :					Optional[int]=10      ,				UpperCamelCase      :					int=10_24      ,				UpperCamelCase      :					Optional[Any]=1_28      ,				**UpperCamelCase      :					Optional[Any]      ,				):


    '''simple docstring'''





    super().__init__(**UpperCamelCase							)

    _snake_case   :				Tuple														=	hidden_size
    _snake_case   :				str														=	num_hidden_layers
    _snake_case   :				Optional[Any]														=	num_attention_heads
    _snake_case   :				Optional[Any]														=	intermediate_size
    _snake_case   :				Optional[Any]														=	hidden_act
    _snake_case   :				List[str]														=	hidden_dropout_prob
    _snake_case   :				Union[str, Any]														=	attention_probs_dropout_prob
    _snake_case   :				Any														=	initializer_range
    _snake_case   :				List[str]														=	layer_norm_eps
    _snake_case   :				int														=	patch_size
    _snake_case   :				List[str]														=	qkv_bias
    _snake_case   :				int														=	frequency_stride
    _snake_case   :				List[Any]														=	time_stride
    _snake_case   :				List[Any]														=	max_length
    _snake_case   :				List[str]														=	num_mel_bins




