





import math

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


lowercase_					     =	logging.get_logger(__name__)

lowercase_					     =	{
    """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        SCREAMING_SNAKE_CASE     (UpperCAmelCase   ):
   _UpperCamelCase					:	Any				      = 'data2vec-audio'


   def __init__(					self    :       List[str]    ,  a    :       Optional[Any]=32    ,  a    :       Optional[int]=768    ,  a    :       Optional[int]=12    ,  a    :       List[Any]=12    ,  a    :       Optional[int]=3_072    ,  a    :       List[Any]="gelu"    ,  a    :       Optional[Any]=0.1    ,  a    :       List[Any]=0.1    ,  a    :       Optional[int]=0.1    ,  a    :       Dict=0.0    ,  a    :       Optional[Any]=0.1    ,  a    :       List[Any]=0.1    ,  a    :       List[str]=0.02    ,  a    :       Any=1E-5    ,  a    :       Optional[int]="gelu"    ,  a    :       Optional[Any]=(512, 512, 512, 512, 512, 512, 512)    ,  a    :       List[str]=(5, 2, 2, 2, 2, 2, 2)    ,  a    :       Dict=(10, 3, 3, 3, 3, 2, 2)    ,  a    :       str=False    ,  a    :       int=16    ,  a    :       Dict=19    ,  a    :       int=5    ,  a    :       Optional[Any]=0.05    ,  a    :       Tuple=10    ,  a    :       int=2    ,  a    :       Optional[Any]=0.0    ,  a    :       Any=10    ,  a    :       Any=0    ,  a    :       List[Any]="sum"    ,  a    :       str=False    ,  a    :       Dict=False    ,  a    :       Optional[Any]=256    ,  a    :       Optional[Any]=(512, 512, 512, 512, 1_500)    ,  a    :       Tuple=(5, 3, 3, 1, 1)    ,  a    :       List[Any]=(1, 2, 3, 1, 1)    ,  a    :       int=512    ,  a    :       List[str]=0    ,  a    :       Tuple=1    ,  a    :       Dict=2    ,  a    :       Dict=False    ,  a    :       Optional[Any]=3    ,  a    :       List[str]=2    ,  a    :       Union[str, Any]=3    ,  a    :       Optional[Any]=None    ,  **a    :       Optional[Any]    ,  )->     List[Any]:





     """simple docstring"""







     super().__init__(**a    ,  pad_token_id=a    ,  bos_token_id=a    ,  eos_token_id=a )
     lowercase__			    =						hidden_size
     lowercase__			    =						feat_extract_activation
     lowercase__			    =						list(a )
     lowercase__			    =						list(a )
     lowercase__			    =						list(a )
     lowercase__			    =						conv_bias
     lowercase__			    =						num_conv_pos_embeddings
     lowercase__			    =						num_conv_pos_embedding_groups
     lowercase__			    =						conv_pos_kernel_size
     lowercase__			    =						len(self.conv_dim )
     lowercase__			    =						num_hidden_layers
     lowercase__			    =						intermediate_size
     lowercase__			    =						hidden_act
     lowercase__			    =						num_attention_heads
     lowercase__			    =						hidden_dropout
     lowercase__			    =						attention_dropout
     lowercase__			    =						activation_dropout
     lowercase__			    =						feat_proj_dropout
     lowercase__			    =						final_dropout
     lowercase__			    =						layerdrop
     lowercase__			    =						layer_norm_eps
     lowercase__			    =						initializer_range
     lowercase__			    =						vocab_size
     lowercase__			    =						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
     lowercase__			    =						mask_time_prob
     lowercase__			    =						mask_time_length
     lowercase__			    =						mask_time_min_masks
     lowercase__			    =						mask_feature_prob
     lowercase__			    =						mask_feature_length
     lowercase__			    =						mask_feature_min_masks

     # ctc loss
     lowercase__			    =						ctc_loss_reduction
     lowercase__			    =						ctc_zero_infinity

     # adapter
     lowercase__			    =						add_adapter
     lowercase__			    =						adapter_kernel_size
     lowercase__			    =						adapter_stride
     lowercase__			    =						num_adapter_layers
     lowercase__			    =						output_hidden_size or hidden_size

     # SequenceClassification-specific parameter. Feel free to ignore for other classes.
     lowercase__			    =						classifier_proj_size

     # XVector-specific parameters. Feel free to ignore for other classes.
     lowercase__			    =						list(a )
     lowercase__			    =						list(a )
     lowercase__			    =						list(a )
     lowercase__			    =						xvector_output_dim


   @property
   def  SCREAMING_SNAKE_CASE_							(					self    :       Any )->     Union[str, Any]:





     """simple docstring"""







     return math.prod(self.conv_stride )









from string import ascii_uppercase

lowercase_					     =	{str(ord(c) - 55): c for c in ascii_uppercase}




def     __UpperCamelCase						(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	)       ->     str:
  if isinstance(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	):
    raise TypeError('int() can\'t convert non-string with explicit base'	)
  if num < 0:
    raise ValueError('parameter must be positive int'	)
  if isinstance(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	):
    raise TypeError('\'str\' object cannot be interpreted as an integer'	)
  if isinstance(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	):
    raise TypeError('\'float\' object cannot be interpreted as an integer'	)
  if base in (0, 1):
    raise ValueError('base must be >= 2'	)
  if base > 36:
    raise ValueError('base must be <= 36'	)
  lowercase__			    =						''
  lowercase__			    =						0
  lowercase__			    =						0
  while div != 1:
    lowercase__    ,					lowercase__			    =						divmod(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	)
    if base >= 11 and 9 < mod < 36:
      lowercase__			    =						ALPHABET_VALUES[str(_SCREAMING_SNAKE_CASE	)]
    else:
      lowercase__			    =						str(_SCREAMING_SNAKE_CASE	)
    new_value += actual_value
    lowercase__			    =						num // base
    lowercase__			    =						div
    if div == 0:
      return str(new_value[::-1]	)
    elif div == 1:
      new_value += str(_SCREAMING_SNAKE_CASE	)
      return str(new_value[::-1]	)

  return new_value[::-1]


if __name__ == "__main__":
      import doctest

      doctest.testmod()

      for base in range(2, 37):
            for num in range(1_000):
                  assert int(decimal_to_any(num, base), base) == num, (
                      num,
                      base,
                      decimal_to_any(num, base),
                      int(decimal_to_any(num, base), base),
                  )


