


"""simple docstring"""







import pytest

import datasets


# Import fixture modules as plugins
lowerCamelCase_       :       List[Any]      						=  ["""tests.fixtures.files""", """tests.fixtures.hub""", """tests.fixtures.fsspec"""]
def _A						(						lowercase	,   lowercase		):







    """simple docstring"""
    # 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						(						lowercase		):







    """simple docstring"""
    config.addinivalue_line('''markers'''	,   '''torchaudio_latest: mark test to run with torchaudio>=0.12'''		)
@pytest.fixture(autouse=lowercase		)
def _A						(						lowercase	,   lowercase		):







    """simple docstring"""
    # test_hf_cache_home = tmp_path_factory.mktemp("cache")  # TODO: why a cache dir per test function does not work?
    a					=tmp_path_factory.getbasetemp() / '''cache'''
    a					=test_hf_cache_home / '''datasets'''
    a					=test_hf_cache_home / '''metrics'''
    a					=test_hf_cache_home / '''modules'''
    monkeypatch.setattr('''datasets.config.HF_DATASETS_CACHE'''	,   str(lowercase		)		)
    monkeypatch.setattr('''datasets.config.HF_METRICS_CACHE'''	,   str(lowercase		)		)
    monkeypatch.setattr('''datasets.config.HF_MODULES_CACHE'''	,   str(lowercase		)		)
    a					=test_hf_datasets_cache / '''downloads'''
    monkeypatch.setattr('''datasets.config.DOWNLOADED_DATASETS_PATH'''	,   str(lowercase		)		)
    a					=test_hf_datasets_cache / '''downloads''' / '''extracted'''
    monkeypatch.setattr('''datasets.config.EXTRACTED_DATASETS_PATH'''	,   str(lowercase		)		)
@pytest.fixture(autouse=lowercase	,   scope='''session'''		)
def _A						(						):







    """simple docstring"""
    datasets.disable_progress_bar()
@pytest.fixture(autouse=lowercase		)
def _A						(						lowercase		):







    """simple docstring"""
    # don't take tests into account when counting downloads
    monkeypatch.setattr('''datasets.config.HF_UPDATE_DOWNLOAD_COUNTS'''	,   lowercase		)





@pytest.fixture
def _A						(						lowercase		):







    """simple docstring"""
    # 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'''	,   lowercase		)



"""simple docstring"""







from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_sentencepiece_available,
    is_tokenizers_available,
    is_torch_available,
    is_vision_available,
)


lowerCamelCase_       :       Union[str, Any]      						=  {"""processing_layoutxlm""": ["""LayoutXLMProcessor"""]}

try:
       if not is_sentencepiece_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       lowerCamelCase_       :       Optional[int]      						=  ["""LayoutXLMTokenizer"""]

try:
       if not is_tokenizers_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       lowerCamelCase_       :       Dict      						=  ["""LayoutXLMTokenizerFast"""]

if TYPE_CHECKING:
       from .processing_layoutxlm import LayoutXLMProcessor

       try:
              if not is_sentencepiece_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .tokenization_layoutxlm import LayoutXLMTokenizer

       try:
              if not is_tokenizers_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .tokenization_layoutxlm_fast import LayoutXLMTokenizerFast

else:
       import sys

       lowerCamelCase_       :       Union[str, Any]      						=  _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)