





import math

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


__lowerCamelCase	:					List[Any]			  =					logging.get_logger(__name__)

__lowerCamelCase	:					Optional[int]			  =					{
    """facebook/data2vec-base-960h""": """https://huggingface.co/facebook/data2vec-audio-base-960h/resolve/main/config.json""",
    # See all Data2VecAudio models at https://huggingface.co/models?filter=data2vec-audio
}



class  A__       (	__snake_case      ):
      _UpperCAmelCase     :Optional[int]						   =       'data2vec-audio'





      def __init__(			self	,							A_=32	,							A_=768	,							A_=12	,							A_=12	,							A_=3072	,							A_="gelu"	,							A_=0.1	,							A_=0.1	,							A_=0.1	,							A_=0.0	,							A_=0.1	,							A_=0.1	,							A_=0.02	,							A_=1e-5	,							A_="gelu"	,							A_=(512, 512, 512, 512, 512, 512, 512)	,							A_=(5, 2, 2, 2, 2, 2, 2)	,							A_=(10, 3, 3, 3, 3, 2, 2)	,							A_=False	,							A_=16	,							A_=19	,							A_=5	,							A_=0.05	,							A_=10	,							A_=2	,							A_=0.0	,							A_=10	,							A_=0	,							A_="sum"	,							A_=False	,							A_=False	,							A_=256	,							A_=(512, 512, 512, 512, 1500)	,							A_=(5, 3, 3, 1, 1)	,							A_=(1, 2, 3, 1, 1)	,							A_=512	,							A_=0	,							A_=1	,							A_=2	,							A_=False	,							A_=3	,							A_=2	,							A_=3	,							A_=None	,							**A_	,							):
       '''simple docstring'''




       super().__init__(**A_	,							pad_token_id=A_	,							bos_token_id=A_	,							eos_token_id=A_       )
       UpperCamelCase     : Union[str, Any]	     =       hidden_size
       UpperCamelCase     : Union[str, Any]	     =       feat_extract_activation
       UpperCamelCase     : str	     =       list(A_       )
       UpperCamelCase     : Union[str, Any]	     =       list(A_       )
       UpperCamelCase     : Optional[int]	     =       list(A_       )
       UpperCamelCase     : int	     =       conv_bias
       UpperCamelCase     : Optional[int]	     =       num_conv_pos_embeddings
       UpperCamelCase     : Optional[Any]	     =       num_conv_pos_embedding_groups
       UpperCamelCase     : List[Any]	     =       conv_pos_kernel_size
       UpperCamelCase     : str	     =       len(self.conv_dim       )
       UpperCamelCase     : Optional[Any]	     =       num_hidden_layers
       UpperCamelCase     : List[Any]	     =       intermediate_size
       UpperCamelCase     : Any	     =       hidden_act
       UpperCamelCase     : List[Any]	     =       num_attention_heads
       UpperCamelCase     : List[Any]	     =       hidden_dropout
       UpperCamelCase     : List[Any]	     =       attention_dropout
       UpperCamelCase     : Optional[int]	     =       activation_dropout
       UpperCamelCase     : Optional[int]	     =       feat_proj_dropout
       UpperCamelCase     : Tuple	     =       final_dropout
       UpperCamelCase     : List[str]	     =       layerdrop
       UpperCamelCase     : Any	     =       layer_norm_eps
       UpperCamelCase     : Tuple	     =       initializer_range
       UpperCamelCase     : Dict	     =       vocab_size
       UpperCamelCase     : List[Any]	     =       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
       UpperCamelCase     : str	     =       mask_time_prob
       UpperCamelCase     : Dict	     =       mask_time_length
       UpperCamelCase     : Dict	     =       mask_time_min_masks
       UpperCamelCase     : Optional[Any]	     =       mask_feature_prob
       UpperCamelCase     : Union[str, Any]	     =       mask_feature_length
       UpperCamelCase     : Optional[int]	     =       mask_feature_min_masks

       # ctc loss
       UpperCamelCase     : Any	     =       ctc_loss_reduction
       UpperCamelCase     : Optional[Any]	     =       ctc_zero_infinity

       # adapter
       UpperCamelCase     : Tuple	     =       add_adapter
       UpperCamelCase     : Tuple	     =       adapter_kernel_size
       UpperCamelCase     : List[Any]	     =       adapter_stride
       UpperCamelCase     : List[str]	     =       num_adapter_layers
       UpperCamelCase     : Optional[Any]	     =       output_hidden_size or hidden_size

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

       # XVector-specific parameters. Feel free to ignore for other classes.
       UpperCamelCase     : Tuple	     =       list(A_       )
       UpperCamelCase     : Tuple	     =       list(A_       )
       UpperCamelCase     : Dict	     =       list(A_       )
       UpperCamelCase     : Union[str, Any]	     =       xvector_output_dim





      @property
      def 	__UpperCamelCase(			self       ):
       '''simple docstring'''




       return math.prod(self.conv_stride       )







def 		A_    (					_lowerCAmelCase = "The quick brown fox jumps over the lazy dog"							,       )						->			bool:
 UpperCamelCase     : Union[str, Any]	     =       set()

 # Replace all the whitespace in our sentence
 UpperCamelCase     : Union[str, Any]	     =       input_str.replace(" "							,       ""					)
 for alpha in input_str:
  if "a" <= alpha.lower() <= "z":
   frequency.add(alpha.lower()					)
 return len(_lowerCAmelCase					) == 26



def 		A_    (					_lowerCAmelCase = "The quick brown fox jumps over the lazy dog"							,       )						->			bool:
 UpperCamelCase     : List[Any]	     =       [False] * 26
 for char in input_str:
  if char.islower():
   UpperCamelCase     : Tuple	     =       True
  elif char.isupper():
   UpperCamelCase     : str	     =       True
 return all(_lowerCAmelCase					)



def 		A_    (					_lowerCAmelCase = "The quick brown fox jumps over the lazy dog"							,       )						->			bool:
 return len({char for char in input_str.lower() if char.isalpha()}					) == 26



def 		A_    (					)						->			None:
 from timeit import timeit

 UpperCamelCase     : Tuple	     =       "from __main__ import is_pangram, is_pangram_faster, is_pangram_fastest"
 print(timeit("is_pangram()"							,       setup=_lowerCAmelCase					)					)
 print(timeit("is_pangram_faster()"							,       setup=_lowerCAmelCase					)					)
 print(timeit("is_pangram_fastest()"							,       setup=_lowerCAmelCase					)					)
 # 5.348480500048026, 2.6477354579837993, 1.8470395830227062
 # 5.036091582966037, 2.644472333951853,  1.8869528750656173


if __name__ == "__main__":
    import doctest

    doctest.testmod()
    benchmark()
