


"""simple docstring"""
import functools
import operator

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


UpperCAmelCase				=						logging.get_logger(__name__)

UpperCAmelCase				=						{
    """facebook/wav2vec2-base-960h""": """https://huggingface.co/facebook/wav2vec2-base-960h/resolve/main/config.json""",
    # See all Wav2Vec2 models at https://huggingface.co/models?filter=wav2vec2
}




class 	lowercase__				(					A_				):
   __UpperCAmelCase							       =					'''wav2vec2'''





   def __init__(							self      ,   SCREAMING_SNAKE_CASE=32      ,   SCREAMING_SNAKE_CASE=768      ,   SCREAMING_SNAKE_CASE=12      ,   SCREAMING_SNAKE_CASE=12      ,   SCREAMING_SNAKE_CASE=3072      ,   SCREAMING_SNAKE_CASE="gelu"      ,   SCREAMING_SNAKE_CASE=0.1      ,   SCREAMING_SNAKE_CASE=0.1      ,   SCREAMING_SNAKE_CASE=0.1      ,   SCREAMING_SNAKE_CASE=0.0      ,   SCREAMING_SNAKE_CASE=0.0      ,   SCREAMING_SNAKE_CASE=0.1      ,   SCREAMING_SNAKE_CASE=0.1      ,   SCREAMING_SNAKE_CASE=0.02      ,   SCREAMING_SNAKE_CASE=1e-5      ,   SCREAMING_SNAKE_CASE="group"      ,   SCREAMING_SNAKE_CASE="gelu"      ,   SCREAMING_SNAKE_CASE=(512, 512, 512, 512, 512, 512, 512)      ,   SCREAMING_SNAKE_CASE=(5, 2, 2, 2, 2, 2, 2)      ,   SCREAMING_SNAKE_CASE=(10, 3, 3, 3, 3, 2, 2)      ,   SCREAMING_SNAKE_CASE=False      ,   SCREAMING_SNAKE_CASE=128      ,   SCREAMING_SNAKE_CASE=16      ,   SCREAMING_SNAKE_CASE=False      ,   SCREAMING_SNAKE_CASE=True      ,   SCREAMING_SNAKE_CASE=0.05      ,   SCREAMING_SNAKE_CASE=10      ,   SCREAMING_SNAKE_CASE=2      ,   SCREAMING_SNAKE_CASE=0.0      ,   SCREAMING_SNAKE_CASE=10      ,   SCREAMING_SNAKE_CASE=0      ,   SCREAMING_SNAKE_CASE=320      ,   SCREAMING_SNAKE_CASE=2      ,   SCREAMING_SNAKE_CASE=0.1      ,   SCREAMING_SNAKE_CASE=100      ,   SCREAMING_SNAKE_CASE=256      ,   SCREAMING_SNAKE_CASE=256      ,   SCREAMING_SNAKE_CASE=0.1      ,   SCREAMING_SNAKE_CASE="sum"      ,   SCREAMING_SNAKE_CASE=False      ,   SCREAMING_SNAKE_CASE=False      ,   SCREAMING_SNAKE_CASE=256      ,   SCREAMING_SNAKE_CASE=(512, 512, 512, 512, 1500)      ,   SCREAMING_SNAKE_CASE=(5, 3, 3, 1, 1)      ,   SCREAMING_SNAKE_CASE=(1, 2, 3, 1, 1)      ,   SCREAMING_SNAKE_CASE=512      ,   SCREAMING_SNAKE_CASE=0      ,   SCREAMING_SNAKE_CASE=1      ,   SCREAMING_SNAKE_CASE=2      ,   SCREAMING_SNAKE_CASE=False      ,   SCREAMING_SNAKE_CASE=3      ,   SCREAMING_SNAKE_CASE=2      ,   SCREAMING_SNAKE_CASE=3      ,   SCREAMING_SNAKE_CASE=None      ,   SCREAMING_SNAKE_CASE=None      ,   **SCREAMING_SNAKE_CASE      ,   )  ->  Tuple:
      super().__init__(**SCREAMING_SNAKE_CASE      ,   pad_token_id=SCREAMING_SNAKE_CASE      ,   bos_token_id=SCREAMING_SNAKE_CASE      ,   eos_token_id=SCREAMING_SNAKE_CASE)
      _lowerCamelCase	:					Dict   =		hidden_size
      _lowerCamelCase	:					List[str]   =		feat_extract_norm
      _lowerCamelCase	:					Optional[Any]   =		feat_extract_activation
      _lowerCamelCase	:					Optional[int]   =		list(SCREAMING_SNAKE_CASE)
      _lowerCamelCase	:					List[Any]   =		list(SCREAMING_SNAKE_CASE)
      _lowerCamelCase	:					List[Any]   =		list(SCREAMING_SNAKE_CASE)
      _lowerCamelCase	:					Optional[int]   =		conv_bias
      _lowerCamelCase	:					Union[str, Any]   =		num_conv_pos_embeddings
      _lowerCamelCase	:					Dict   =		num_conv_pos_embedding_groups
      _lowerCamelCase	:					Tuple   =		len(self.conv_dim)
      _lowerCamelCase	:					Any   =		num_hidden_layers
      _lowerCamelCase	:					Union[str, Any]   =		intermediate_size
      _lowerCamelCase	:					Optional[int]   =		hidden_act
      _lowerCamelCase	:					Tuple   =		num_attention_heads
      _lowerCamelCase	:					List[str]   =		hidden_dropout
      _lowerCamelCase	:					Tuple   =		attention_dropout
      _lowerCamelCase	:					Optional[int]   =		activation_dropout
      _lowerCamelCase	:					Optional[int]   =		feat_proj_dropout
      _lowerCamelCase	:					str   =		final_dropout
      _lowerCamelCase	:					List[str]   =		layerdrop
      _lowerCamelCase	:					Tuple   =		layer_norm_eps
      _lowerCamelCase	:					List[str]   =		initializer_range
      _lowerCamelCase	:					List[Any]   =		vocab_size
      _lowerCamelCase	:					str   =		do_stable_layer_norm
      _lowerCamelCase	:					str   =		use_weighted_layer_sum

      if (
          (len(self.conv_stride) != self.num_feat_extract_layers)
          or (len(self.conv_kernel) != self.num_feat_extract_layers)
          or (len(self.conv_dim) != self.num_feat_extract_layers)
      ):
         raise ValueError(
             """Configuration for convolutional layers is incorrect. It is required that `len(config.conv_dim)` =="""
             """ `len(config.conv_stride)` == `len(config.conv_kernel)`, but is `len(config.conv_dim) ="""
             F' {len(self.conv_dim)}`, `len(config.conv_stride) = {len(self.conv_stride)}`,'
             F' `len(config.conv_kernel) = {len(self.conv_kernel)}`.')

      # fine-tuning config parameters for SpecAugment: https://arxiv.org/abs/1904.08779
      _lowerCamelCase	:					List[str]   =		apply_spec_augment
      _lowerCamelCase	:					List[str]   =		mask_time_prob
      _lowerCamelCase	:					List[Any]   =		mask_time_length
      _lowerCamelCase	:					Optional[int]   =		mask_time_min_masks
      _lowerCamelCase	:					Optional[Any]   =		mask_feature_prob
      _lowerCamelCase	:					Optional[int]   =		mask_feature_length
      _lowerCamelCase	:					Any   =		mask_feature_min_masks

      # parameters for pretraining with codevector quantized representations
      _lowerCamelCase	:					Optional[int]   =		num_codevectors_per_group
      _lowerCamelCase	:					Union[str, Any]   =		num_codevector_groups
      _lowerCamelCase	:					List[str]   =		contrastive_logits_temperature
      _lowerCamelCase	:					List[Any]   =		feat_quantizer_dropout
      _lowerCamelCase	:					List[Any]   =		num_negatives
      _lowerCamelCase	:					Optional[Any]   =		codevector_dim
      _lowerCamelCase	:					Union[str, Any]   =		proj_codevector_dim
      _lowerCamelCase	:					Optional[int]   =		diversity_loss_weight

      # ctc loss
      _lowerCamelCase	:					str   =		ctc_loss_reduction
      _lowerCamelCase	:					Any   =		ctc_zero_infinity

      # adapter
      _lowerCamelCase	:					str   =		add_adapter
      _lowerCamelCase	:					List[Any]   =		adapter_kernel_size
      _lowerCamelCase	:					List[Any]   =		adapter_stride
      _lowerCamelCase	:					List[str]   =		num_adapter_layers
      _lowerCamelCase	:					int   =		output_hidden_size or hidden_size
      _lowerCamelCase	:					Union[str, Any]   =		adapter_attn_dim

      # SequenceClassification-specific parameter. Feel free to ignore for other classes.
      _lowerCamelCase	:					int   =		classifier_proj_size

      # XVector-specific parameters. Feel free to ignore for other classes.
      _lowerCamelCase	:					Optional[Any]   =		list(SCREAMING_SNAKE_CASE)
      _lowerCamelCase	:					int   =		list(SCREAMING_SNAKE_CASE)
      _lowerCamelCase	:					Dict   =		list(SCREAMING_SNAKE_CASE)
      _lowerCamelCase	:					Tuple   =		xvector_output_dim





   @property
   def 		UpperCamelCase_  (							self)  ->  Union[str, Any]:
      return functools.reduce(operator.mul      ,   self.conv_stride      ,   1)






from __future__ import annotations



def 		lowerCAmelCase__     (       UpperCamelCase_					:							dict			,							UpperCamelCase_					:							str						)->	set[str]:
    A__			,						A__					=       set(UpperCamelCase_						), [start]

    while stack:
        A__					=       stack.pop()
        explored.add(UpperCamelCase_						)
        # Differences from BFS:
        # 1) pop last element instead of first one
        # 2) add adjacent elements to stack without exploring them
        for adj in reversed(graph[v]						):
            if adj not in explored:
                stack.append(UpperCamelCase_						)
    return explored


_lowercase    	=		{
    "A": ["B", "C", "D"],
    "B": ["A", "D", "E"],
    "C": ["A", "F"],
    "D": ["B", "D"],
    "E": ["B", "F"],
    "F": ["C", "E", "G"],
    "G": ["F"],
}

if __name__ == "__main__":
   import doctest

   doctest.testmod()
   print(depth_first_search(G, "A"))
