






'''simple docstring'''





from typing import Callable, Optional

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


    '''simple docstring'''

    def __init__(					self     :     Any				,     __lowerCamelCase     :     Callable				,     __lowerCamelCase     :     Optional[Features] = None				,     __lowerCamelCase     :     str = None				,     __lowerCamelCase     :     bool = False				,     __lowerCamelCase     :     bool = False				,     __lowerCamelCase     :     Optional[dict] = None				,     __lowerCamelCase     :     Optional[int] = None				,     **__lowerCamelCase     :     Tuple				,     )							->							Optional[Any]:

     '''simple docstring'''




     super().__init__(
         features=__lowerCamelCase				,     cache_dir=__lowerCamelCase				,     keep_in_memory=__lowerCamelCase				,     streaming=__lowerCamelCase				,     num_proc=__lowerCamelCase				,     **__lowerCamelCase				,     )
     lowerCamelCase__  =     Generator(
         cache_dir=__lowerCamelCase				,     features=__lowerCamelCase				,     generator=__lowerCamelCase				,     gen_kwargs=__lowerCamelCase				,     **__lowerCamelCase				,     )




    def    a__				(					self     :     Optional[Any]     )							->							List[Any]:

     '''simple docstring'''




     if self.streaming:
      lowerCamelCase__  =     self.builder.as_streaming_dataset(split="train"     )
     # Build regular (map-style) dataset
     else:
      lowerCamelCase__  =     None
      lowerCamelCase__  =     None
      lowerCamelCase__  =     None
      lowerCamelCase__  =     None

      self.builder.download_and_prepare(
          download_config=__lowerCamelCase				,     download_mode=__lowerCamelCase				,     verification_mode=__lowerCamelCase				,     base_path=__lowerCamelCase				,     num_proc=self.num_proc				,     )
      lowerCamelCase__  =     self.builder.as_dataset(
          split="train"				,     verification_mode=__lowerCamelCase				,     in_memory=self.keep_in_memory     )
     return dataset









'''simple docstring'''





from ..utils import DummyObject, requires_backends
class 				lowercase       (							metaclass=_lowerCamelCase      ):


    '''simple docstring'''

    lowerCAmelCase__      				=							["flax", "transformers"]

    def __init__(					self     :     List[str]				,     *__lowerCamelCase     :     int				,     **__lowerCamelCase     :     Any     )							->							Optional[int]:

     '''simple docstring'''




     requires_backends(self				,     ["flax", "transformers"]     )

    @classmethod
    def    a__				(					cls     :     Any				,     *__lowerCamelCase     :     Optional[int]				,     **__lowerCamelCase     :     Dict     )							->							str:

     '''simple docstring'''




     requires_backends(cls				,     ["flax", "transformers"]     )




    @classmethod
    def    a__				(					cls     :     str				,     *__lowerCamelCase     :     str				,     **__lowerCamelCase     :     Any     )							->							str:

     '''simple docstring'''




     requires_backends(cls				,     ["flax", "transformers"]     )
class 				lowercase       (							metaclass=_lowerCamelCase      ):


    '''simple docstring'''

    lowerCAmelCase__      				=							["flax", "transformers"]

    def __init__(					self     :     str				,     *__lowerCamelCase     :     List[Any]				,     **__lowerCamelCase     :     int     )							->							List[str]:

     '''simple docstring'''




     requires_backends(self				,     ["flax", "transformers"]     )

    @classmethod
    def    a__				(					cls     :     Dict				,     *__lowerCamelCase     :     Any				,     **__lowerCamelCase     :     str     )							->							Optional[int]:

     '''simple docstring'''




     requires_backends(cls				,     ["flax", "transformers"]     )




    @classmethod
    def    a__				(					cls     :     Any				,     *__lowerCamelCase     :     int				,     **__lowerCamelCase     :     Dict     )							->							int:

     '''simple docstring'''




     requires_backends(cls				,     ["flax", "transformers"]     )
class 				lowercase       (							metaclass=_lowerCamelCase      ):


    '''simple docstring'''

    lowerCAmelCase__      				=							["flax", "transformers"]

    def __init__(					self     :     Dict				,     *__lowerCamelCase     :     str				,     **__lowerCamelCase     :     List[Any]     )							->							str:

     '''simple docstring'''




     requires_backends(self				,     ["flax", "transformers"]     )

    @classmethod
    def    a__				(					cls     :     Optional[int]				,     *__lowerCamelCase     :     Optional[int]				,     **__lowerCamelCase     :     Optional[Any]     )							->							Dict:

     '''simple docstring'''




     requires_backends(cls				,     ["flax", "transformers"]     )




    @classmethod
    def    a__				(					cls     :     Optional[int]				,     *__lowerCamelCase     :     Dict				,     **__lowerCamelCase     :     List[str]     )							->							Dict:

     '''simple docstring'''




     requires_backends(cls				,     ["flax", "transformers"]     )
class 				lowercase       (							metaclass=_lowerCamelCase      ):


    '''simple docstring'''

    lowerCAmelCase__      				=							["flax", "transformers"]

    def __init__(					self     :     int				,     *__lowerCamelCase     :     List[str]				,     **__lowerCamelCase     :     int     )							->							Optional[int]:

     '''simple docstring'''




     requires_backends(self				,     ["flax", "transformers"]     )

    @classmethod
    def    a__				(					cls     :     Any				,     *__lowerCamelCase     :     Tuple				,     **__lowerCamelCase     :     str     )							->							List[str]:

     '''simple docstring'''




     requires_backends(cls				,     ["flax", "transformers"]     )




    @classmethod
    def    a__				(					cls     :     List[Any]				,     *__lowerCamelCase     :     List[str]				,     **__lowerCamelCase     :     List[Any]     )							->							int:

     '''simple docstring'''




     requires_backends(cls				,     ["flax", "transformers"]     )

