


import asyncio
import os
import re
import sys
import tempfile
import unittest
from contextlib import contextmanager
from copy import deepcopy
from distutils.util import strtobool
from enum import Enum
from importlib.util import find_spec
from pathlib import Path
from unittest.mock import patch

import pyarrow as pa
import pytest
import requests
from packaging import version

from datasets import config


if config.PY_VERSION < version.parse('''3.8'''):
   import importlib_metadata
else:
   import importlib.metadata as importlib_metadata



def       _lowerCAmelCase    (				lowerCAmelCase_				:Any		,    lowerCAmelCase_				:int=False				)->Dict:
   '''simple docstring'''






   try:
      snake_case_            =       os.environ[key]
   except KeyError:
      # KEY isn't set, default to `default`.
      snake_case_            =       default
   else:
      # KEY is set, convert it to True or False.
      try:
         snake_case_            =       strtobool(lowerCAmelCase_				)
      except ValueError:
         # More values are supported, but let's keep the message simple.
         raise ValueError(F'''If set, {key} must be yes or no.'''				)
   return _value


SCREAMING_SNAKE_CASE						:int			=  parse_flag_from_env('''RUN_SLOW''', default=False)
SCREAMING_SNAKE_CASE						:str			=  parse_flag_from_env('''RUN_REMOTE''', default=False)
SCREAMING_SNAKE_CASE						:List[Any]			=  parse_flag_from_env('''RUN_LOCAL''', default=True)
SCREAMING_SNAKE_CASE						:str			=  parse_flag_from_env('''RUN_PACKAGED''', default=True)

# Compression
SCREAMING_SNAKE_CASE						:Union[str, Any]			=  pytest.mark.skipif(not config.LZ4_AVAILABLE, reason='''test requires lz4''')
SCREAMING_SNAKE_CASE						:Optional[int]			=  pytest.mark.skipif(not config.PY7ZR_AVAILABLE, reason='''test requires py7zr''')
SCREAMING_SNAKE_CASE						:Any			=  pytest.mark.skipif(not config.ZSTANDARD_AVAILABLE, reason='''test requires zstandard''')

# Audio
SCREAMING_SNAKE_CASE						:Union[str, Any]			=  pytest.mark.skipif(
    # On Windows and OS X, soundfile installs sndfile
    find_spec('''soundfile''') is None or version.parse(importlib_metadata.version('''soundfile''')) < version.parse('''0.12.0'''),
    reason='''test requires sndfile>=0.12.1: \'pip install \"soundfile>=0.12.1\"\'; ''',
)

# Beam
SCREAMING_SNAKE_CASE						:Optional[Any]			=  pytest.mark.skipif(
    not config.BEAM_AVAILABLE or config.DILL_VERSION >= version.parse('''0.3.2'''),
    reason='''test requires apache-beam and a compatible dill version''',
)

# Dill-cloudpickle compatibility
SCREAMING_SNAKE_CASE						:Dict			=  pytest.mark.skipif(
    config.DILL_VERSION <= version.parse('''0.3.2'''),
    reason='''test requires dill>0.3.2 for cloudpickle compatibility''',
)

# Windows
SCREAMING_SNAKE_CASE						:List[Any]			=  pytest.mark.skipif(
    sys.platform == '''win32''',
    reason='''test should not be run on Windows''',
)



def       _lowerCAmelCase    (				lowerCAmelCase_				:int				)->List[Any]:
   '''simple docstring'''






   try:
      import faiss  # noqa
   except ImportError:
      snake_case_            =       unittest.skip("test requires faiss"				)(lowerCAmelCase_				)
   return test_case



def       _lowerCAmelCase    (				lowerCAmelCase_				:Optional[int]				)->int:
   '''simple docstring'''






   try:
      import regex  # noqa
   except ImportError:
      snake_case_            =       unittest.skip("test requires regex"				)(lowerCAmelCase_				)
   return test_case



def       _lowerCAmelCase    (				lowerCAmelCase_				:List[str]				)->str:
   '''simple docstring'''






   try:
      import elasticsearch  # noqa
   except ImportError:
      snake_case_            =       unittest.skip("test requires elasticsearch"				)(lowerCAmelCase_				)
   return test_case



def       _lowerCAmelCase    (				lowerCAmelCase_				:str				)->Dict:
   '''simple docstring'''






   try:
      import sqlalchemy  # noqa
   except ImportError:
      snake_case_            =       unittest.skip("test requires sqlalchemy"				)(lowerCAmelCase_				)
   return test_case



def       _lowerCAmelCase    (				lowerCAmelCase_				:List[Any]				)->Any:
   '''simple docstring'''






   if not config.TORCH_AVAILABLE:
      snake_case_            =       unittest.skip("test requires PyTorch"				)(lowerCAmelCase_				)
   return test_case



def       _lowerCAmelCase    (				lowerCAmelCase_				:Dict				)->int:
   '''simple docstring'''






   if not config.TF_AVAILABLE:
      snake_case_            =       unittest.skip("test requires TensorFlow"				)(lowerCAmelCase_				)
   return test_case



def       _lowerCAmelCase    (				lowerCAmelCase_				:List[str]				)->Any:
   '''simple docstring'''






   if not config.JAX_AVAILABLE:
      snake_case_            =       unittest.skip("test requires JAX"				)(lowerCAmelCase_				)
   return test_case



def       _lowerCAmelCase    (				lowerCAmelCase_				:Any				)->Dict:
   '''simple docstring'''






   if not config.PIL_AVAILABLE:
      snake_case_            =       unittest.skip("test requires Pillow"				)(lowerCAmelCase_				)
   return test_case



def       _lowerCAmelCase    (				lowerCAmelCase_				:int				)->Optional[Any]:
   '''simple docstring'''






   try:
      import transformers  # noqa F401
   except ImportError:
      return unittest.skip("test requires transformers"				)(lowerCAmelCase_				)
   else:
      return test_case



def       _lowerCAmelCase    (				lowerCAmelCase_				:Any				)->str:
   '''simple docstring'''






   try:
      import tiktoken  # noqa F401
   except ImportError:
      return unittest.skip("test requires tiktoken"				)(lowerCAmelCase_				)
   else:
      return test_case



def       _lowerCAmelCase    (				lowerCAmelCase_				:int				)->Tuple:
   '''simple docstring'''






   try:
      import spacy  # noqa F401
   except ImportError:
      return unittest.skip("test requires spacy"				)(lowerCAmelCase_				)
   else:
      return test_case



def       _lowerCAmelCase    (				lowerCAmelCase_				:Union[str, Any]				)->Any:
   '''simple docstring'''






   def _require_spacy_model(lowerCAmelCase_				:Any				):
      try:
         import spacy  # noqa F401

         spacy.load(lowerCAmelCase_				)
      except ImportError:
         return unittest.skip("test requires spacy"				)(lowerCAmelCase_				)
      except OSError:
         return unittest.skip("test requires spacy model '{}'".format(lowerCAmelCase_				)				)(lowerCAmelCase_				)
      else:
         return test_case

   return _require_spacy_model



def       _lowerCAmelCase    (				lowerCAmelCase_				:int				)->Dict:
   '''simple docstring'''






   try:
      import pyspark  # noqa F401
   except ImportError:
      return unittest.skip("test requires pyspark"				)(lowerCAmelCase_				)
   else:
      return test_case



def       _lowerCAmelCase    (				lowerCAmelCase_				:Any				)->List[Any]:
   '''simple docstring'''






   try:
      import joblibspark  # noqa F401
   except ImportError:
      return unittest.skip("test requires joblibspark"				)(lowerCAmelCase_				)
   else:
      return test_case



def       _lowerCAmelCase    (				lowerCAmelCase_				:Optional[Any]				)->List[Any]:
   '''simple docstring'''






   if not _run_slow_tests or _run_slow_tests == 0:
      snake_case_            =       unittest.skip("test is slow"				)(lowerCAmelCase_				)
   return test_case



def       _lowerCAmelCase    (				lowerCAmelCase_				:Union[str, Any]				)->Optional[Any]:
   '''simple docstring'''






   if not _run_local_tests or _run_local_tests == 0:
      snake_case_            =       unittest.skip("test is local"				)(lowerCAmelCase_				)
   return test_case



def       _lowerCAmelCase    (				lowerCAmelCase_				:Tuple				)->str:
   '''simple docstring'''






   if not _run_packaged_tests or _run_packaged_tests == 0:
      snake_case_            =       unittest.skip("test is packaged"				)(lowerCAmelCase_				)
   return test_case



def       _lowerCAmelCase    (				lowerCAmelCase_				:str				)->Optional[int]:
   '''simple docstring'''






   if not _run_remote_tests or _run_remote_tests == 0:
      snake_case_            =       unittest.skip("test requires remote"				)(lowerCAmelCase_				)
   return test_case



def       _lowerCAmelCase    (				*lowerCAmelCase_				:Tuple				)->Tuple:
   '''simple docstring'''






   def decorate(cls				:Optional[int]				):
      for name, fn in cls.__dict__.items():
         if callable(lowerCAmelCase_				) and name.startswith("test"				):
            for decorator in decorators:
               snake_case_            =       decorator(lowerCAmelCase_				)
            setattr(cls		,    lowerCAmelCase_		,    lowerCAmelCase_				)
      return cls

   return decorate


class      __lowerCAmelCase  (			a       ):






  """simple docstring"""





  pass






class      __lowerCAmelCase  (			a       ):






  """simple docstring"""





  _SCREAMING_SNAKE_CASE		     =							0
  _SCREAMING_SNAKE_CASE		     =							1
  _SCREAMING_SNAKE_CASE		     =							2






@contextmanager
def       _lowerCAmelCase    (				lowerCAmelCase_				:Tuple=OfflineSimulationMode.CONNECTION_FAILS		,    lowerCAmelCase_				:Optional[Any]=1e-16				)->Tuple:
   '''simple docstring'''






   snake_case_            =       requests.Session().request

   def timeout_request(lowerCAmelCase_				:List[Any]		,    lowerCAmelCase_				:Union[str, Any]		,    lowerCAmelCase_				:int		,    **lowerCAmelCase_				:Any				):
      # Change the url to an invalid url so that the connection hangs
      snake_case_            =       "https://10.255.255.1"
      if kwargs.get("timeout"				) is None:
         raise RequestWouldHangIndefinitelyError(
             F'''Tried a call to {url} in offline mode with no timeout set. Please set a timeout.'''				)
      snake_case_            =       timeout
      try:
         return online_request(lowerCAmelCase_		,    lowerCAmelCase_		,    **lowerCAmelCase_				)
      except Exception as e:
         # The following changes in the error are just here to make the offline timeout error prettier
         snake_case_            =       url
         snake_case_            =       e.args[0]
         snake_case_            =       (max_retry_error.args[0].replace("10.255.255.1"		,    F'''OfflineMock[{url}]'''				),)
         snake_case_            =       (max_retry_error,)
         raise

   def raise_connection_error(lowerCAmelCase_				:List[Any]		,    lowerCAmelCase_				:Optional[Any]		,    **lowerCAmelCase_				:Optional[Any]				):
      raise requests.ConnectionError("Offline mode is enabled."		,    request=lowerCAmelCase_				)

   if mode is OfflineSimulationMode.CONNECTION_FAILS:
      with patch("requests.Session.send"		,    lowerCAmelCase_				):
         yield
   elif mode is OfflineSimulationMode.CONNECTION_TIMES_OUT:
      # inspired from https://stackoverflow.com/a/904609
      with patch("requests.Session.request"		,    lowerCAmelCase_				):
         yield
   elif mode is OfflineSimulationMode.HF_DATASETS_OFFLINE_SET_TO_1:
      with patch("datasets.config.HF_DATASETS_OFFLINE"		,    lowerCAmelCase_				):
         yield
   else:
      raise ValueError("Please use a value from the OfflineSimulationMode enum."				)



@contextmanager
def       _lowerCAmelCase    (				*lowerCAmelCase_				:Dict		,    **lowerCAmelCase_				:int				)->Dict:
   '''simple docstring'''






   snake_case_            =       str(Path().resolve()				)
   with tempfile.TemporaryDirectory(*lowerCAmelCase_		,    **lowerCAmelCase_				) as tmp_dir:
      try:
         os.chdir(lowerCAmelCase_				)
         yield
      finally:
         os.chdir(lowerCAmelCase_				)



@contextmanager
def       _lowerCAmelCase    (				)->Tuple:
   '''simple docstring'''






   import gc

   gc.collect()
   snake_case_            =       pa.total_allocated_bytes()
   yield
   assert pa.total_allocated_bytes() - previous_allocated_memory > 0, "Arrow memory didn't increase."



@contextmanager
def       _lowerCAmelCase    (				)->str:
   '''simple docstring'''






   import gc

   gc.collect()
   snake_case_            =       pa.total_allocated_bytes()
   yield
   assert pa.total_allocated_bytes() - previous_allocated_memory <= 0, "Arrow memory wasn't expected to increase."



def       _lowerCAmelCase    (				lowerCAmelCase_				:Dict		,    lowerCAmelCase_				:Optional[int]				)->List[str]:
   '''simple docstring'''






   return deepcopy(lowerCAmelCase_				).integers(0		,    100		,    10				).tolist() == deepcopy(lowerCAmelCase_				).integers(0		,    100		,    10				).tolist()



def       _lowerCAmelCase    (				lowerCAmelCase_				:Tuple				)->Any:
   '''simple docstring'''






   import decorator
   from requests.exceptions import HTTPError

   def _wrapper(lowerCAmelCase_				:int		,    *lowerCAmelCase_				:str		,    **lowerCAmelCase_				:Optional[Any]				):
      try:
         return func(*lowerCAmelCase_		,    **lowerCAmelCase_				)
      except HTTPError as err:
         if str(lowerCAmelCase_				).startswith("500"				) or str(lowerCAmelCase_				).startswith("502"				):
            pytest.xfail(str(lowerCAmelCase_				)				)
         raise err

   return decorator.decorator(_wrapper		,    lowerCAmelCase_				)


class      __lowerCAmelCase  :






  """simple docstring"""





  def __init__(  self							:							Optional[Any]     ,					_lowerCAmelCase							:							Optional[Any]     ,					_lowerCAmelCase							:							Any     ,					_lowerCAmelCase							:							Any	) ->			int:




     """simple docstring"""
     snake_case_            =       returncode
     snake_case_            =       stdout
     snake_case_            =       stderr






async def       _lowerCAmelCase    (				lowerCAmelCase_				:str		,    lowerCAmelCase_				:List[Any]				)->int:
   '''simple docstring'''






   while True:
      snake_case_            =       await stream.readline()
      if line:
         callback(lowerCAmelCase_				)
      else:
         break



async def       _lowerCAmelCase    (				lowerCAmelCase_				:Tuple		,    lowerCAmelCase_				:List[str]=None		,    lowerCAmelCase_				:List[str]=None		,    lowerCAmelCase_				:Union[str, Any]=None		,    lowerCAmelCase_				:Tuple=False		,    lowerCAmelCase_				:int=False				)->_RunOutput:
   '''simple docstring'''






   if echo:
      print("\nRunning: "		,    " ".join(lowerCAmelCase_				)				)

   snake_case_            =       await asyncio.create_subprocess_exec(
       cmd[0]		,    *cmd[1:]		,    stdin=lowerCAmelCase_		,    stdout=asyncio.subprocess.PIPE		,    stderr=asyncio.subprocess.PIPE		,    env=lowerCAmelCase_		,    )

   # note: there is a warning for a possible deadlock when using `wait` with huge amounts of data in the pipe
   # https://docs.python.org/3/library/asyncio-subprocess.html#asyncio.asyncio.subprocess.Process.wait
   #
   # If it starts hanging, will need to switch to the following code. The problem is that no data
   # will be seen until it's done and if it hangs for example there will be no debug info.
   # out, err = await p.communicate()
   # return _RunOutput(p.returncode, out, err)

   snake_case_            =       []
   snake_case_            =       []

   def tee(lowerCAmelCase_				:int		,    lowerCAmelCase_				:str		,    lowerCAmelCase_				:Tuple		,    lowerCAmelCase_				:str=""				):
      snake_case_            =       line.decode("utf-8"				).rstrip()
      sink.append(lowerCAmelCase_				)
      if not quiet:
         print(lowerCAmelCase_		,    lowerCAmelCase_		,    file=lowerCAmelCase_				)

    # XXX: the timeout doesn't seem to make any difference here
   await asyncio.wait(
       [
           _read_stream(p.stdout		,    lambda lowerCAmelCase_				: tee(lowerCAmelCase_		,    lowerCAmelCase_		,    sys.stdout		,    label="stdout:"				)				),
           _read_stream(p.stderr		,    lambda lowerCAmelCase_				: tee(lowerCAmelCase_		,    lowerCAmelCase_		,    sys.stderr		,    label="stderr:"				)				),
       ]		,    timeout=lowerCAmelCase_		,    )
   return _RunOutput(await p.wait()		,    lowerCAmelCase_		,    lowerCAmelCase_				)



def       _lowerCAmelCase    (				lowerCAmelCase_				:Optional[int]		,    lowerCAmelCase_				:Optional[Any]=None		,    lowerCAmelCase_				:str=None		,    lowerCAmelCase_				:List[Any]=180		,    lowerCAmelCase_				:Any=False		,    lowerCAmelCase_				:Dict=True				)->_RunOutput:
   '''simple docstring'''






   snake_case_            =       asyncio.get_event_loop()
   snake_case_            =       loop.run_until_complete(
       _stream_subprocess(lowerCAmelCase_		,    env=lowerCAmelCase_		,    stdin=lowerCAmelCase_		,    timeout=lowerCAmelCase_		,    quiet=lowerCAmelCase_		,    echo=lowerCAmelCase_				)				)

   snake_case_            =       " ".join(lowerCAmelCase_				)
   if result.returncode > 0:
      snake_case_            =       "\n".join(result.stderr				)
      raise RuntimeError(
          F'''\'{cmd_str}\' failed with returncode {result.returncode}\n\n'''
          F'''The combined stderr from workers follows:\n{stderr}'''				)

   # check that the subprocess actually did run and produced some output, should the test rely on
   # the remote side to do the testing
   if not result.stdout and not result.stderr:
      raise RuntimeError(F'''\'{cmd_str}\' produced no output.'''				)

   return result



def       _lowerCAmelCase    (				)->Union[str, Any]:
   '''simple docstring'''






   snake_case_            =       os.environ.get("PYTEST_XDIST_WORKER"		,    "gw0"				)
   snake_case_            =       re.sub(r"^gw"		,    ""		,    lowerCAmelCase_		,    0		,    re.M				)
   return int(lowerCAmelCase_				)



def       _lowerCAmelCase    (				)->Optional[Any]:
   '''simple docstring'''






   snake_case_            =       29_500
   snake_case_            =       pytest_xdist_worker_id()
   return port + uniq_delta








import functools
import operator

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


SCREAMING_SNAKE_CASE						:List[str]			=  logging.get_logger(__name__)

SCREAMING_SNAKE_CASE						:Dict			=  {
    '''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      __lowerCAmelCase  (			a       ):






  """simple docstring"""





  _SCREAMING_SNAKE_CASE		     =							'wav2vec2'



  def __init__(  self							:							Any     ,					_lowerCAmelCase							:							Optional[Any]=3_2     ,					_lowerCAmelCase							:							List[Any]=7_6_8     ,					_lowerCAmelCase							:							Dict=1_2     ,					_lowerCAmelCase							:							Tuple=1_2     ,					_lowerCAmelCase							:							Optional[int]=3_0_7_2     ,					_lowerCAmelCase							:							Any="gelu"     ,					_lowerCAmelCase							:							List[str]=0.1     ,					_lowerCAmelCase							:							Dict=0.1     ,					_lowerCAmelCase							:							Union[str, Any]=0.1     ,					_lowerCAmelCase							:							Dict=0.0     ,					_lowerCAmelCase							:							Optional[int]=0.0     ,					_lowerCAmelCase							:							List[Any]=0.1     ,					_lowerCAmelCase							:							List[Any]=0.1     ,					_lowerCAmelCase							:							Dict=0.02     ,					_lowerCAmelCase							:							Any=1e-5     ,					_lowerCAmelCase							:							Any="group"     ,					_lowerCAmelCase							:							Union[str, Any]="gelu"     ,					_lowerCAmelCase							:							str=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2, 5_1_2)     ,					_lowerCAmelCase							:							Optional[Any]=(5, 2, 2, 2, 2, 2, 2)     ,					_lowerCAmelCase							:							Optional[Any]=(1_0, 3, 3, 3, 3, 2, 2)     ,					_lowerCAmelCase							:							int=False     ,					_lowerCAmelCase							:							int=1_2_8     ,					_lowerCAmelCase							:							Union[str, Any]=1_6     ,					_lowerCAmelCase							:							Union[str, Any]=False     ,					_lowerCAmelCase							:							List[Any]=True     ,					_lowerCAmelCase							:							Dict=0.05     ,					_lowerCAmelCase							:							List[str]=1_0     ,					_lowerCAmelCase							:							Tuple=2     ,					_lowerCAmelCase							:							str=0.0     ,					_lowerCAmelCase							:							Union[str, Any]=1_0     ,					_lowerCAmelCase							:							int=0     ,					_lowerCAmelCase							:							Optional[int]=3_2_0     ,					_lowerCAmelCase							:							Optional[Any]=2     ,					_lowerCAmelCase							:							str=0.1     ,					_lowerCAmelCase							:							Optional[Any]=1_0_0     ,					_lowerCAmelCase							:							Tuple=2_5_6     ,					_lowerCAmelCase							:							Union[str, Any]=2_5_6     ,					_lowerCAmelCase							:							Union[str, Any]=0.1     ,					_lowerCAmelCase							:							Optional[Any]="sum"     ,					_lowerCAmelCase							:							List[str]=False     ,					_lowerCAmelCase							:							List[Any]=False     ,					_lowerCAmelCase							:							List[str]=2_5_6     ,					_lowerCAmelCase							:							List[Any]=(5_1_2, 5_1_2, 5_1_2, 5_1_2, 1_5_0_0)     ,					_lowerCAmelCase							:							List[str]=(5, 3, 3, 1, 1)     ,					_lowerCAmelCase							:							Union[str, Any]=(1, 2, 3, 1, 1)     ,					_lowerCAmelCase							:							Optional[Any]=5_1_2     ,					_lowerCAmelCase							:							Any=0     ,					_lowerCAmelCase							:							Optional[int]=1     ,					_lowerCAmelCase							:							List[str]=2     ,					_lowerCAmelCase							:							Tuple=False     ,					_lowerCAmelCase							:							Any=3     ,					_lowerCAmelCase							:							List[Any]=2     ,					_lowerCAmelCase							:							Optional[Any]=3     ,					_lowerCAmelCase							:							List[str]=None     ,					_lowerCAmelCase							:							str=None     ,					**_lowerCAmelCase							:							Tuple     ,					) ->			Optional[int]:




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

     # parameters for pretraining with codevector quantized representations
     snake_case_            =       num_codevectors_per_group
     snake_case_            =       num_codevector_groups
     snake_case_            =       contrastive_logits_temperature
     snake_case_            =       feat_quantizer_dropout
     snake_case_            =       num_negatives
     snake_case_            =       codevector_dim
     snake_case_            =       proj_codevector_dim
     snake_case_            =       diversity_loss_weight

     # ctc loss
     snake_case_            =       ctc_loss_reduction
     snake_case_            =       ctc_zero_infinity

     # adapter
     snake_case_            =       add_adapter
     snake_case_            =       adapter_kernel_size
     snake_case_            =       adapter_stride
     snake_case_            =       num_adapter_layers
     snake_case_            =       output_hidden_size or hidden_size
     snake_case_            =       adapter_attn_dim

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

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



  @property
  def        lowerCAmelCase__	(  self							:							str	) ->			int:




     """simple docstring"""
     return functools.reduce(operator.mul     ,					self.conv_stride     ,					1	)




