


from typing import Callable, Optional

from .. import Features
from ..packaged_modules.generator.generator import Generator
from .abc import AbstractDatasetInputStream



class 							_UpperCamelCase (						A						):

   '''simple docstring'''







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






         '''simple docstring'''



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


   def   _snake_case    (  self  : Optional[int]							):






         '''simple docstring'''



         if self.streaming:
               __lowerCamelCase     :      List[Any]       						=						self.builder.as_streaming_dataset(split="""train"""							)
         # Build regular (map-style) dataset
         else:
               __lowerCamelCase     :      List[str]       						=						None
               __lowerCamelCase     :      Tuple       						=						None
               __lowerCamelCase     :      Optional[int]       						=						None
               __lowerCamelCase     :      Optional[int]       						=						None

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







from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__UpperCamelCase    :						Any     =							{
    'configuration_timesformer': ['TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP', 'TimesformerConfig'],
}

try:
    if not is_torch_available():
        raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
    pass
else:
    __UpperCamelCase    :						int     =							[
        'TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST',
        'TimesformerModel',
        'TimesformerForVideoClassification',
        'TimesformerPreTrainedModel',
    ]

if TYPE_CHECKING:
    from .configuration_timesformer import TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, TimesformerConfig

    try:
        if not is_torch_available():
            raise OptionalDependencyNotAvailable()
    except OptionalDependencyNotAvailable:
        pass
    else:
        from .modeling_timesformer import (
            TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
            TimesformerForVideoClassification,
            TimesformerModel,
            TimesformerPreTrainedModel,
        )

else:
    import sys

    __UpperCamelCase    :						List[Any]     =							_LazyModule(__name__, globals()['__file__'], _import_structure, module_spec=__spec__)



