


'''simple docstring'''







import sys
import warnings
from os.path import abspath, dirname, join


# allow having multiple repository checkouts and not needing to remember to rerun
# 'pip install -e .[dev]' when switching between checkouts and running tests.
A__:    Union[str, Any]					    =       abspath(join(dirname(dirname(dirname(__file__))), '''src'''))
sys.path.insert(1, git_repo_path)


# silence FutureWarning warnings in tests since often we can't act on them until
# they become normal warnings - i.e. the tests still need to test the current functionality
warnings.simplefilter(action='''ignore''', category=FutureWarning)


def 	SCREAMING_SNAKE_CASE_					(  _UpperCAmelCase	:	Optional[Any]  )  ->			int:
       from transformers.testing_utils import pytest_addoption_shared

       pytest_addoption_shared(__a  )


def 	SCREAMING_SNAKE_CASE_					(  _UpperCAmelCase	:	Optional[int]  )  ->			List[str]:
       from transformers.testing_utils import pytest_terminal_summary_main

       _a    : List[str]     					=terminalreporter.config.getoption("""--make-reports"""  )
       if make_reports:
              pytest_terminal_summary_main(__a    ,id=__a  )






'''simple docstring'''
from typing import Callable, Optional

from .. import Features
from ..packaged_modules.generator.generator import Generator
from .abc import AbstractDatasetInputStream
class    lowercase	(							A__					):

		"""simple docstring"""

		def __init__(		self    ,   UpperCamelCase_    ,   UpperCamelCase_ = None    ,   UpperCamelCase_ = None    ,   UpperCamelCase_ = False    ,   UpperCamelCase_ = False    ,   UpperCamelCase_ = None    ,   UpperCamelCase_ = None    ,   **UpperCamelCase_    ,   ):

							'''simple docstring'''


							super().__init__(
							    features=UpperCamelCase_    ,   cache_dir=UpperCamelCase_    ,   keep_in_memory=UpperCamelCase_    ,   streaming=UpperCamelCase_    ,   num_proc=UpperCamelCase_    ,   **UpperCamelCase_    ,   )
							UpperCamelCase__   :Any												= Generator(
							    cache_dir=UpperCamelCase_    ,   features=UpperCamelCase_    ,   generator=UpperCamelCase_    ,   gen_kwargs=UpperCamelCase_    ,   **UpperCamelCase_    ,   )




		def     lowerCAmelCase__				(		self							):

							'''simple docstring'''


							if self.streaming:
												UpperCamelCase__   :Optional[Any]												= self.builder.as_streaming_dataset(split='''train'''							)
							# Build regular (map-style) dataset
							else:
												UpperCamelCase__   :Optional[int]												= None
												UpperCamelCase__   :int												= None
												UpperCamelCase__   :Any												= None
												UpperCamelCase__   :Any												= None

												self.builder.download_and_prepare(
												    download_config=UpperCamelCase_    ,   download_mode=UpperCamelCase_    ,   verification_mode=UpperCamelCase_    ,   base_path=UpperCamelCase_    ,   num_proc=self.num_proc    ,   )
												UpperCamelCase__   :List[Any]												= self.builder.as_dataset(
												    split='''train'''    ,   verification_mode=UpperCamelCase_    ,   in_memory=self.keep_in_memory							)
							return dataset