





from typing import Optional

from .. import Features, NamedSplit
from ..packaged_modules.text.text import Text
from ..utils.typing import NestedDataStructureLike, PathLike
from .abc import AbstractDatasetReader


class 			lowercase				(							a_     ):



      """simple docstring"""

      def __init__(    self			:		List[str] ,				lowerCamelCase_			:		NestedDataStructureLike[PathLike] ,				lowerCamelCase_			:		Optional[NamedSplit] = None ,				lowerCamelCase_			:		Optional[Features] = None ,				lowerCamelCase_			:		str = None ,				lowerCamelCase_			:		bool = False ,				lowerCamelCase_			:		bool = False ,				lowerCamelCase_			:		Optional[int] = None ,				**lowerCamelCase_			:		Optional[Any] ,				):





          '''simple docstring'''







          super().__init__(
              __UpperCamelCase ,				split=__UpperCamelCase ,				features=__UpperCamelCase ,				cache_dir=__UpperCamelCase ,				keep_in_memory=__UpperCamelCase ,				streaming=__UpperCamelCase ,				num_proc=__UpperCamelCase ,				**__UpperCamelCase ,				)
          _snake_case :			Union[str, Any]  						=   path_or_paths if isinstance(__UpperCamelCase ,				__UpperCamelCase					) else {self.split: path_or_paths}
          _snake_case :			Union[str, Any]  						=   Text(
              cache_dir=__UpperCamelCase ,				data_files=__UpperCamelCase ,				features=__UpperCamelCase ,				**__UpperCamelCase ,				)







      def 		__UpperCAmelCase       (    self			:		Optional[Any]					):





          '''simple docstring'''







          if self.streaming:
              _snake_case :			Any  						=   self.builder.as_streaming_dataset(split=self.split					)
          # Build regular (map-style) dataset
          else:
              _snake_case :			Dict  						=   None
              _snake_case :			str  						=   None
              _snake_case :			Optional[Any]  						=   None
              _snake_case :			str  						=   None

              self.builder.download_and_prepare(
                  download_config=__UpperCamelCase ,				download_mode=__UpperCamelCase ,				verification_mode=__UpperCamelCase ,				base_path=__UpperCamelCase ,				num_proc=self.num_proc ,				)
              _snake_case :			str  						=   self.builder.as_dataset(
                  split=self.split ,				verification_mode=__UpperCamelCase ,				in_memory=self.keep_in_memory					)
          return dataset













from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
)


lowercase_		:				Optional[int]				=						{
    '''configuration_mega''': ['''MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''MegaConfig''', '''MegaOnnxConfig'''],
}

try:
		if not is_torch_available():
				raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
		pass
else:
		lowercase_		:				Any				=						[
		    '''MEGA_PRETRAINED_MODEL_ARCHIVE_LIST''',
		    '''MegaForCausalLM''',
		    '''MegaForMaskedLM''',
		    '''MegaForMultipleChoice''',
		    '''MegaForQuestionAnswering''',
		    '''MegaForSequenceClassification''',
		    '''MegaForTokenClassification''',
		    '''MegaModel''',
		    '''MegaPreTrainedModel''',
		]

if TYPE_CHECKING:
		from .configuration_mega import MEGA_PRETRAINED_CONFIG_ARCHIVE_MAP, MegaConfig, MegaOnnxConfig

		try:
				if not is_torch_available():
						raise OptionalDependencyNotAvailable()
		except OptionalDependencyNotAvailable:
				pass
		else:
				from .modeling_mega import (
				    MEGA_PRETRAINED_MODEL_ARCHIVE_LIST,
				    MegaForCausalLM,
				    MegaForMaskedLM,
				    MegaForMultipleChoice,
				    MegaForQuestionAnswering,
				    MegaForSequenceClassification,
				    MegaForTokenClassification,
				    MegaModel,
				    MegaPreTrainedModel,
				)

else:
		import sys

		lowercase_		:				str				=						_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)






