

"""simple docstring"""






from typing import Callable, Optional

from .. import Features
from ..packaged_modules.generator.generator import Generator
from .abc import AbstractDatasetInputStream
class        _lowercase					(     __UpperCAmelCase     ):







     def __init__(      self ,						UpperCamelCase_ ,						UpperCamelCase_ = None ,						UpperCamelCase_ = None ,						UpperCamelCase_ = False ,						UpperCamelCase_ = False ,						UpperCamelCase_ = None ,						UpperCamelCase_ = None ,						**UpperCamelCase_ ,						):
      super().__init__(
          features=UpperCamelCase_ ,						cache_dir=UpperCamelCase_ ,						keep_in_memory=UpperCamelCase_ ,						streaming=UpperCamelCase_ ,						num_proc=UpperCamelCase_ ,						**UpperCamelCase_ ,						)
      __magic_name__     =      Generator(
          cache_dir=UpperCamelCase_ ,						features=UpperCamelCase_ ,						generator=UpperCamelCase_ ,						gen_kwargs=UpperCamelCase_ ,						**UpperCamelCase_ ,						)







     def 	lowerCAmelCase__    (      self       ):
      # Build iterable dataset
      if self.streaming:
       __magic_name__     =      self.builder.as_streaming_dataset(split='''train'''       )
      # Build regular (map-style) dataset
      else:
       __magic_name__     =      None
       __magic_name__     =      None
       __magic_name__     =      None
       __magic_name__     =      None

       self.builder.download_and_prepare(
           download_config=UpperCamelCase_ ,						download_mode=UpperCamelCase_ ,						verification_mode=UpperCamelCase_ ,						base_path=UpperCamelCase_ ,						num_proc=self.num_proc ,						)
       __magic_name__     =      self.builder.as_dataset(
           split='''train''' ,						verification_mode=UpperCamelCase_ ,						in_memory=self.keep_in_memory       )
      return dataset




"""simple docstring"""






import pytest

import datasets


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





def 	lowercase      (   __UpperCamelCase      ,   __UpperCamelCase						) ->      str:
 # 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 	lowercase      (   __UpperCamelCase						) ->      Union[str, Any]:
 config.addinivalue_line('''markers'''      ,   '''torchaudio_latest: mark test to run with torchaudio>=0.12'''						)





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





@pytest.fixture(autouse=__UpperCamelCase      ,   scope='''session'''						)
def 	lowercase      (   ) ->      Any:
 datasets.disable_progress_bar()





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





@pytest.fixture
def 	lowercase      (   __UpperCamelCase						) ->      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'''      ,   __UpperCamelCase						)

