


'''simple docstring'''
import pytest

import datasets


# Import fixture modules as plugins
UpperCamelCase__    					=      ['''tests.fixtures.files''', '''tests.fixtures.hub''', '''tests.fixtures.fsspec''']





def 					a__       (					lowerCAmelCase__  ,					lowerCAmelCase__						)    ->	Optional[int]:
    # Mark tests as "unit" by default if not marked as "integration" (or already marked as "unit")
    for item in items:
        if any(marker in item.keywords for marker in ['''integration''', '''unit''']						):
            continue
        item.add_marker(pytest.mark.unit						)





def 					a__       (					lowerCAmelCase__						)    ->	List[str]:
    config.addinivalue_line('''markers'''  ,					'''torchaudio_latest: mark test to run with torchaudio>=0.12'''						)





@pytest.fixture(autouse=lowerCAmelCase__						)
def 					a__       (					lowerCAmelCase__  ,					lowerCAmelCase__						)    ->	int:
    # test_hf_cache_home = tmp_path_factory.mktemp("cache")  # TODO: why a cache dir per test function does not work?
    UpperCAmelCase__			:		str													=				tmp_path_factory.getbasetemp() / '''cache'''
    UpperCAmelCase__			:		Any													=				test_hf_cache_home / '''datasets'''
    UpperCAmelCase__			:		Optional[int]													=				test_hf_cache_home / '''metrics'''
    UpperCAmelCase__			:		Tuple													=				test_hf_cache_home / '''modules'''
    monkeypatch.setattr('''datasets.config.HF_DATASETS_CACHE'''  ,					str(lowerCAmelCase__						)						)
    monkeypatch.setattr('''datasets.config.HF_METRICS_CACHE'''  ,					str(lowerCAmelCase__						)						)
    monkeypatch.setattr('''datasets.config.HF_MODULES_CACHE'''  ,					str(lowerCAmelCase__						)						)
    UpperCAmelCase__			:		List[Any]													=				test_hf_datasets_cache / '''downloads'''
    monkeypatch.setattr('''datasets.config.DOWNLOADED_DATASETS_PATH'''  ,					str(lowerCAmelCase__						)						)
    UpperCAmelCase__			:		Union[str, Any]													=				test_hf_datasets_cache / '''downloads''' / '''extracted'''
    monkeypatch.setattr('''datasets.config.EXTRACTED_DATASETS_PATH'''  ,					str(lowerCAmelCase__						)						)





@pytest.fixture(autouse=lowerCAmelCase__  ,					scope='''session'''						)
def 					a__       (					)    ->	Optional[Any]:
    datasets.disable_progress_bar()





@pytest.fixture(autouse=lowerCAmelCase__						)
def 					a__       (					lowerCAmelCase__						)    ->	Any:
    # don't take tests into account when counting downloads
    monkeypatch.setattr('''datasets.config.HF_UPDATE_DOWNLOAD_COUNTS'''  ,					lowerCAmelCase__						)







@pytest.fixture
def 					a__       (					lowerCAmelCase__						)    ->	Optional[int]:
    # Required to suppress RemovedIn20Warning when feature(s) are not compatible with SQLAlchemy 2.0
    # To be removed once SQLAlchemy 2.0 supported
    monkeypatch.setattr('''sqlalchemy.util.deprecations.SILENCE_UBER_WARNING'''  ,					lowerCAmelCase__						)




'''simple docstring'''
from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


UpperCamelCase__    					=      {
    '''configuration_distilbert''': [
        '''DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''DistilBertConfig''',
        '''DistilBertOnnxConfig''',
    ],
    '''tokenization_distilbert''': ['''DistilBertTokenizer'''],
}

try:
  if not is_tokenizers_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCamelCase__    					=      ['''DistilBertTokenizerFast''']

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCamelCase__    					=      [
      '''DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST''',
      '''DistilBertForMaskedLM''',
      '''DistilBertForMultipleChoice''',
      '''DistilBertForQuestionAnswering''',
      '''DistilBertForSequenceClassification''',
      '''DistilBertForTokenClassification''',
      '''DistilBertModel''',
      '''DistilBertPreTrainedModel''',
  ]

try:
  if not is_tf_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCamelCase__    					=      [
      '''TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST''',
      '''TFDistilBertForMaskedLM''',
      '''TFDistilBertForMultipleChoice''',
      '''TFDistilBertForQuestionAnswering''',
      '''TFDistilBertForSequenceClassification''',
      '''TFDistilBertForTokenClassification''',
      '''TFDistilBertMainLayer''',
      '''TFDistilBertModel''',
      '''TFDistilBertPreTrainedModel''',
  ]

try:
  if not is_flax_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCamelCase__    					=      [
      '''FlaxDistilBertForMaskedLM''',
      '''FlaxDistilBertForMultipleChoice''',
      '''FlaxDistilBertForQuestionAnswering''',
      '''FlaxDistilBertForSequenceClassification''',
      '''FlaxDistilBertForTokenClassification''',
      '''FlaxDistilBertModel''',
      '''FlaxDistilBertPreTrainedModel''',
  ]


if TYPE_CHECKING:
  from .configuration_distilbert import (
      DISTILBERT_PRETRAINED_CONFIG_ARCHIVE_MAP,
      DistilBertConfig,
      DistilBertOnnxConfig,
  )
  from .tokenization_distilbert import DistilBertTokenizer

  try:
    if not is_tokenizers_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .tokenization_distilbert_fast import DistilBertTokenizerFast

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_distilbert import (
        DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
        DistilBertForMaskedLM,
        DistilBertForMultipleChoice,
        DistilBertForQuestionAnswering,
        DistilBertForSequenceClassification,
        DistilBertForTokenClassification,
        DistilBertModel,
        DistilBertPreTrainedModel,
    )

  try:
    if not is_tf_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_tf_distilbert import (
        TF_DISTILBERT_PRETRAINED_MODEL_ARCHIVE_LIST,
        TFDistilBertForMaskedLM,
        TFDistilBertForMultipleChoice,
        TFDistilBertForQuestionAnswering,
        TFDistilBertForSequenceClassification,
        TFDistilBertForTokenClassification,
        TFDistilBertMainLayer,
        TFDistilBertModel,
        TFDistilBertPreTrainedModel,
    )

  try:
    if not is_flax_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_flax_distilbert import (
        FlaxDistilBertForMaskedLM,
        FlaxDistilBertForMultipleChoice,
        FlaxDistilBertForQuestionAnswering,
        FlaxDistilBertForSequenceClassification,
        FlaxDistilBertForTokenClassification,
        FlaxDistilBertModel,
        FlaxDistilBertPreTrainedModel,
    )

else:
  import sys

  UpperCamelCase__    					=      _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)
