



"""simple docstring"""


import dataclasses
import re
from dataclasses import dataclass
from functools import total_ordering
from typing import Optional, Union


__A   :							Any										=   re.compile(r"^(?P<major>\d+)" r"\.(?P<minor>\d+)" r"\.(?P<patch>\d+)$")
@total_ordering
@dataclass
class 			_a :
			"""simple docstring"""
			UpperCamelCase__			      =	42
			UpperCamelCase__			      =	None
			UpperCamelCase__			      =	None
			UpperCamelCase__			      =	None
			UpperCamelCase__			      =	None



			def  lowercase__						(		self     :    Any   )->str:
							_UpperCAmelCase		,						_UpperCAmelCase		,						_UpperCAmelCase					=    _str_to_version_tuple(self.version_str   )



			def __repr__(		self     :    List[str]   )->Any:
							return F'{self.tuple[0]}.{self.tuple[1]}.{self.tuple[2]}'



			@property
			def  lowercase__						(		self     :    Any   )->Dict:
							return self.major, self.minor, self.patch



			def  lowercase__						(		self     :    Any				,   __UpperCamelCase     :    Tuple   )->List[Any]:
							if isinstance(__UpperCamelCase				,   __UpperCamelCase   ):
											return Version(__UpperCamelCase   )
							elif isinstance(__UpperCamelCase				,   __UpperCamelCase   ):
											return other
							raise TypeError(F'{other} (type {type(__UpperCamelCase   )}) cannot be compared to version.'   )



			def __eq__(		self     :    Optional[Any]				,   __UpperCamelCase     :    Tuple   )->List[Any]:
							try:
											_UpperCAmelCase					=    self._validate_operand(__UpperCamelCase   )
							except (TypeError, ValueError):
											return False
							else:
											return self.tuple == other.tuple



			def __lt__(		self     :    Tuple				,   __UpperCamelCase     :    str   )->Union[str, Any]:
							_UpperCAmelCase					=    self._validate_operand(__UpperCamelCase   )
							return self.tuple < other.tuple



			def __hash__(		self     :    Optional[int]   )->Any:
							return hash(_version_tuple_to_str(self.tuple   )   )



			@classmethod
			def  lowercase__						(		cls     :    List[str]				,   __UpperCamelCase     :    int   )->str:
							_UpperCAmelCase					=    {f.name for f in dataclasses.fields(cls   )}
							return cls(**{k: v for k, v in dic.items() if k in field_names}   )



			def  lowercase__						(		self     :    str   )->str:
							return self.version_str







def  lowercase	(      _SCREAMING_SNAKE_CASE   :						Union[str, Any]				):






				'''simple docstring'''



				_UpperCAmelCase					=    _VERSION_REG.match(_SCREAMING_SNAKE_CASE				)
				if not res:
								raise ValueError(f'Invalid version \'{version_str}\'. Format should be x.y.z with {{x,y,z}} being digits.'				)
				return tuple(int(_SCREAMING_SNAKE_CASE				) for v in [res.group('''major'''				), res.group('''minor'''				), res.group('''patch'''				)]				)







def  lowercase	(      _SCREAMING_SNAKE_CASE   :						Any				):






				'''simple docstring'''



				return ".".join(str(_SCREAMING_SNAKE_CASE				) for v in version_tuple				)








"""simple docstring"""


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 			_a (					lowerCAmelCase):
			"""simple docstring"""



			def __init__(		self     :    List[str]				,   __UpperCamelCase     :    NestedDataStructureLike[PathLike]				,   __UpperCamelCase     :    Optional[NamedSplit] = None				,   __UpperCamelCase     :    Optional[Features] = None				,   __UpperCamelCase     :    str = None				,   __UpperCamelCase     :    bool = False				,   __UpperCamelCase     :    bool = False				,   __UpperCamelCase     :    Optional[int] = None				,   **__UpperCamelCase     :    Optional[Any]				,   )->Any:
							super().__init__(
							    __UpperCamelCase				,   split=__UpperCamelCase				,   features=__UpperCamelCase				,   cache_dir=__UpperCamelCase				,   keep_in_memory=__UpperCamelCase				,   streaming=__UpperCamelCase				,   num_proc=__UpperCamelCase				,   **__UpperCamelCase				,   )
							_UpperCAmelCase					=    path_or_paths if isinstance(__UpperCamelCase				,   __UpperCamelCase   ) else {self.split: path_or_paths}
							_UpperCAmelCase					=    Text(
							    cache_dir=__UpperCamelCase				,   data_files=__UpperCamelCase				,   features=__UpperCamelCase				,   **__UpperCamelCase				,   )



			def  lowercase__						(		self     :    Optional[Any]   )->str:
							# Build iterable dataset
							if self.streaming:
											_UpperCAmelCase					=    self.builder.as_streaming_dataset(split=self.split   )
							# Build regular (map-style) dataset
							else:
											_UpperCAmelCase					=    None
											_UpperCAmelCase					=    None
											_UpperCAmelCase					=    None
											_UpperCAmelCase					=    None

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



