
'''simple docstring'''
from ..utils import DummyObject, requires_backends






class 	snake_case__       (      metaclass=__SCREAMING_SNAKE_CASE					):







		"""simple docstring"""

		lowerCamelCase     							=						["""flax"""]



		def __init__(      self				:			List[Any]  ,	*UpperCamelCase__				:			str  ,	**UpperCamelCase__				:			str      )						->			Tuple:






				"""simple docstring"""







				requires_backends(self  ,	['''flax''']      )



		@classmethod
		def       lowerCAmelCase				(      cls				:			List[Any]  ,	*UpperCamelCase__				:			int  ,	**UpperCamelCase__				:			Optional[int]      )						->			Optional[int]:






				"""simple docstring"""







				requires_backends(cls  ,	['''flax''']      )



		@classmethod
		def       lowerCAmelCase				(      cls				:			Optional[Any]  ,	*UpperCamelCase__				:			Optional[Any]  ,	**UpperCamelCase__				:			Any      )						->			Any:






				"""simple docstring"""







				requires_backends(cls  ,	['''flax''']      )







class 	snake_case__       (      metaclass=__SCREAMING_SNAKE_CASE					):







		"""simple docstring"""

		lowerCamelCase     							=						["""flax"""]



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






				"""simple docstring"""







				requires_backends(self  ,	['''flax''']      )



		@classmethod
		def       lowerCAmelCase				(      cls				:			Any  ,	*UpperCamelCase__				:			Optional[Any]  ,	**UpperCamelCase__				:			List[str]      )						->			List[str]:






				"""simple docstring"""







				requires_backends(cls  ,	['''flax''']      )



		@classmethod
		def       lowerCAmelCase				(      cls				:			List[str]  ,	*UpperCamelCase__				:			Any  ,	**UpperCamelCase__				:			List[Any]      )						->			Any:






				"""simple docstring"""







				requires_backends(cls  ,	['''flax''']      )







class 	snake_case__       (      metaclass=__SCREAMING_SNAKE_CASE					):







		"""simple docstring"""

		lowerCamelCase     							=						["""flax"""]



		def __init__(      self				:			str  ,	*UpperCamelCase__				:			int  ,	**UpperCamelCase__				:			Dict      )						->			Any:






				"""simple docstring"""







				requires_backends(self  ,	['''flax''']      )



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






				"""simple docstring"""







				requires_backends(cls  ,	['''flax''']      )



		@classmethod
		def       lowerCAmelCase				(      cls				:			List[Any]  ,	*UpperCamelCase__				:			Any  ,	**UpperCamelCase__				:			Optional[int]      )						->			Union[str, Any]:






				"""simple docstring"""







				requires_backends(cls  ,	['''flax''']      )







class 	snake_case__       (      metaclass=__SCREAMING_SNAKE_CASE					):







		"""simple docstring"""

		lowerCamelCase     							=						["""flax"""]



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






				"""simple docstring"""







				requires_backends(self  ,	['''flax''']      )



		@classmethod
		def       lowerCAmelCase				(      cls				:			Dict  ,	*UpperCamelCase__				:			Any  ,	**UpperCamelCase__				:			Union[str, Any]      )						->			Dict:






				"""simple docstring"""







				requires_backends(cls  ,	['''flax''']      )



		@classmethod
		def       lowerCAmelCase				(      cls				:			int  ,	*UpperCamelCase__				:			List[Any]  ,	**UpperCamelCase__				:			Optional[int]      )						->			Union[str, Any]:






				"""simple docstring"""







				requires_backends(cls  ,	['''flax''']      )







class 	snake_case__       (      metaclass=__SCREAMING_SNAKE_CASE					):







		"""simple docstring"""

		lowerCamelCase     							=						["""flax"""]



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






				"""simple docstring"""







				requires_backends(self  ,	['''flax''']      )



		@classmethod
		def       lowerCAmelCase				(      cls				:			Any  ,	*UpperCamelCase__				:			Any  ,	**UpperCamelCase__				:			int      )						->			Optional[Any]:






				"""simple docstring"""







				requires_backends(cls  ,	['''flax''']      )



		@classmethod
		def       lowerCAmelCase				(      cls				:			Tuple  ,	*UpperCamelCase__				:			int  ,	**UpperCamelCase__				:			str      )						->			Union[str, Any]:






				"""simple docstring"""







				requires_backends(cls  ,	['''flax''']      )







class 	snake_case__       (      metaclass=__SCREAMING_SNAKE_CASE					):







		"""simple docstring"""

		lowerCamelCase     							=						["""flax"""]



		def __init__(      self				:			int  ,	*UpperCamelCase__				:			int  ,	**UpperCamelCase__				:			int      )						->			int:






				"""simple docstring"""







				requires_backends(self  ,	['''flax''']      )



		@classmethod
		def       lowerCAmelCase				(      cls				:			Dict  ,	*UpperCamelCase__				:			List[str]  ,	**UpperCamelCase__				:			int      )						->			List[Any]:






				"""simple docstring"""







				requires_backends(cls  ,	['''flax''']      )



		@classmethod
		def       lowerCAmelCase				(      cls				:			str  ,	*UpperCamelCase__				:			int  ,	**UpperCamelCase__				:			List[str]      )						->			int:






				"""simple docstring"""







				requires_backends(cls  ,	['''flax''']      )







class 	snake_case__       (      metaclass=__SCREAMING_SNAKE_CASE					):







		"""simple docstring"""

		lowerCamelCase     							=						["""flax"""]



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






				"""simple docstring"""







				requires_backends(self  ,	['''flax''']      )



		@classmethod
		def       lowerCAmelCase				(      cls				:			str  ,	*UpperCamelCase__				:			Union[str, Any]  ,	**UpperCamelCase__				:			Optional[Any]      )						->			Tuple:






				"""simple docstring"""







				requires_backends(cls  ,	['''flax''']      )



		@classmethod
		def       lowerCAmelCase				(      cls				:			Any  ,	*UpperCamelCase__				:			Tuple  ,	**UpperCamelCase__				:			Dict      )						->			List[str]:






				"""simple docstring"""







				requires_backends(cls  ,	['''flax''']      )







class 	snake_case__       (      metaclass=__SCREAMING_SNAKE_CASE					):







		"""simple docstring"""

		lowerCamelCase     							=						["""flax"""]



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






				"""simple docstring"""







				requires_backends(self  ,	['''flax''']      )



		@classmethod
		def       lowerCAmelCase				(      cls				:			Tuple  ,	*UpperCamelCase__				:			Optional[int]  ,	**UpperCamelCase__				:			Optional[int]      )						->			Optional[int]:






				"""simple docstring"""







				requires_backends(cls  ,	['''flax''']      )



		@classmethod
		def       lowerCAmelCase				(      cls				:			int  ,	*UpperCamelCase__				:			List[str]  ,	**UpperCamelCase__				:			Optional[Any]      )						->			str:






				"""simple docstring"""







				requires_backends(cls  ,	['''flax''']      )







class 	snake_case__       (      metaclass=__SCREAMING_SNAKE_CASE					):







		"""simple docstring"""

		lowerCamelCase     							=						["""flax"""]



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






				"""simple docstring"""







				requires_backends(self  ,	['''flax''']      )



		@classmethod
		def       lowerCAmelCase				(      cls				:			Optional[int]  ,	*UpperCamelCase__				:			Optional[int]  ,	**UpperCamelCase__				:			Optional[Any]      )						->			Optional[int]:






				"""simple docstring"""







				requires_backends(cls  ,	['''flax''']      )



		@classmethod
		def       lowerCAmelCase				(      cls				:			Tuple  ,	*UpperCamelCase__				:			str  ,	**UpperCamelCase__				:			Union[str, Any]      )						->			Optional[Any]:






				"""simple docstring"""







				requires_backends(cls  ,	['''flax''']      )







class 	snake_case__       (      metaclass=__SCREAMING_SNAKE_CASE					):







		"""simple docstring"""

		lowerCamelCase     							=						["""flax"""]



		def __init__(      self				:			str  ,	*UpperCamelCase__				:			Any  ,	**UpperCamelCase__				:			Union[str, Any]      )						->			int:






				"""simple docstring"""







				requires_backends(self  ,	['''flax''']      )



		@classmethod
		def       lowerCAmelCase				(      cls				:			List[Any]  ,	*UpperCamelCase__				:			Tuple  ,	**UpperCamelCase__				:			Dict      )						->			List[str]:






				"""simple docstring"""







				requires_backends(cls  ,	['''flax''']      )



		@classmethod
		def       lowerCAmelCase				(      cls				:			Optional[int]  ,	*UpperCamelCase__				:			Dict  ,	**UpperCamelCase__				:			Union[str, Any]      )						->			Dict:






				"""simple docstring"""







				requires_backends(cls  ,	['''flax''']      )







class 	snake_case__       (      metaclass=__SCREAMING_SNAKE_CASE					):







		"""simple docstring"""

		lowerCamelCase     							=						["""flax"""]



		def __init__(      self				:			str  ,	*UpperCamelCase__				:			Union[str, Any]  ,	**UpperCamelCase__				:			Tuple      )						->			Any:






				"""simple docstring"""







				requires_backends(self  ,	['''flax''']      )



		@classmethod
		def       lowerCAmelCase				(      cls				:			List[Any]  ,	*UpperCamelCase__				:			Optional[int]  ,	**UpperCamelCase__				:			List[Any]      )						->			int:






				"""simple docstring"""







				requires_backends(cls  ,	['''flax''']      )



		@classmethod
		def       lowerCAmelCase				(      cls				:			Any  ,	*UpperCamelCase__				:			Dict  ,	**UpperCamelCase__				:			Dict      )						->			Tuple:






				"""simple docstring"""







				requires_backends(cls  ,	['''flax''']      )







class 	snake_case__       (      metaclass=__SCREAMING_SNAKE_CASE					):







		"""simple docstring"""

		lowerCamelCase     							=						["""flax"""]



		def __init__(      self				:			Tuple  ,	*UpperCamelCase__				:			Any  ,	**UpperCamelCase__				:			Dict      )						->			str:






				"""simple docstring"""







				requires_backends(self  ,	['''flax''']      )



		@classmethod
		def       lowerCAmelCase				(      cls				:			List[Any]  ,	*UpperCamelCase__				:			List[Any]  ,	**UpperCamelCase__				:			Optional[Any]      )						->			Any:






				"""simple docstring"""







				requires_backends(cls  ,	['''flax''']      )



		@classmethod
		def       lowerCAmelCase				(      cls				:			str  ,	*UpperCamelCase__				:			int  ,	**UpperCamelCase__				:			int      )						->			int:






				"""simple docstring"""







				requires_backends(cls  ,	['''flax''']      )







class 	snake_case__       (      metaclass=__SCREAMING_SNAKE_CASE					):







		"""simple docstring"""

		lowerCamelCase     							=						["""flax"""]



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






				"""simple docstring"""







				requires_backends(self  ,	['''flax''']      )



		@classmethod
		def       lowerCAmelCase				(      cls				:			List[Any]  ,	*UpperCamelCase__				:			Tuple  ,	**UpperCamelCase__				:			Optional[Any]      )						->			Optional[Any]:






				"""simple docstring"""







				requires_backends(cls  ,	['''flax''']      )



		@classmethod
		def       lowerCAmelCase				(      cls				:			Tuple  ,	*UpperCamelCase__				:			Optional[Any]  ,	**UpperCamelCase__				:			Tuple      )						->			Optional[Any]:






				"""simple docstring"""







				requires_backends(cls  ,	['''flax''']      )




'''simple docstring'''
import enum
import os
from hashlib import shaaaa
from typing import Optional

from .. import config
from .logging import get_logger


lowercase__						       =      get_logger(__name__)






class 	snake_case__       (      enum.Enum					):







		"""simple docstring"""

		lowerCamelCase     							=						"""all_checks"""
		lowerCamelCase     							=						"""basic_checks"""
		lowerCamelCase     							=						"""no_checks"""







class 	snake_case__       (      __SCREAMING_SNAKE_CASE					):







		"""simple docstring"""








class 	snake_case__       (      __SCREAMING_SNAKE_CASE					):







		"""simple docstring"""








class 	snake_case__       (      __SCREAMING_SNAKE_CASE					):







		"""simple docstring"""








class 	snake_case__       (      __SCREAMING_SNAKE_CASE					):







		"""simple docstring"""








def    _UpperCamelCase						(       SCREAMING_SNAKE_CASE__ ,       SCREAMING_SNAKE_CASE__ ,       SCREAMING_SNAKE_CASE__=None			)  ->							str:


		'''simple docstring'''


		if expected_checksums is None:
				logger.info('''Unable to verify checksums.'''			)
				return
		if len(set(SCREAMING_SNAKE_CASE__			) - set(SCREAMING_SNAKE_CASE__			)			) > 0:
				raise ExpectedMoreDownloadedFiles(str(set(SCREAMING_SNAKE_CASE__			) - set(SCREAMING_SNAKE_CASE__			)			)			)
		if len(set(SCREAMING_SNAKE_CASE__			) - set(SCREAMING_SNAKE_CASE__			)			) > 0:
				raise UnexpectedDownloadedFile(str(set(SCREAMING_SNAKE_CASE__			) - set(SCREAMING_SNAKE_CASE__			)			)			)
		snake_case  :       Any     			=						[url for url in expected_checksums if expected_checksums[url] != recorded_checksums[url]]
		snake_case  :       Union[str, Any]     			=						''' for ''' + verification_name if verification_name is not None else ''''''
		if len(SCREAMING_SNAKE_CASE__			) > 0:
				raise NonMatchingChecksumError(
				    F'Checksums didn\'t match{for_verification_name}:\n'
				    F'{bad_urls}\n'
				    '''Set `verification_mode=\'no_checks\'` to skip checksums verification and ignore this error'''			)
		logger.info('''All the checksums matched successfully''' + for_verification_name			)






class 	snake_case__       (      __SCREAMING_SNAKE_CASE					):







		"""simple docstring"""








class 	snake_case__       (      __SCREAMING_SNAKE_CASE					):







		"""simple docstring"""








class 	snake_case__       (      __SCREAMING_SNAKE_CASE					):







		"""simple docstring"""








class 	snake_case__       (      __SCREAMING_SNAKE_CASE					):







		"""simple docstring"""








def    _UpperCamelCase						(       SCREAMING_SNAKE_CASE__ ,       SCREAMING_SNAKE_CASE__			)  ->							List[str]:


		'''simple docstring'''


		if expected_splits is None:
				logger.info('''Unable to verify splits sizes.'''			)
				return
		if len(set(SCREAMING_SNAKE_CASE__			) - set(SCREAMING_SNAKE_CASE__			)			) > 0:
				raise ExpectedMoreSplits(str(set(SCREAMING_SNAKE_CASE__			) - set(SCREAMING_SNAKE_CASE__			)			)			)
		if len(set(SCREAMING_SNAKE_CASE__			) - set(SCREAMING_SNAKE_CASE__			)			) > 0:
				raise UnexpectedSplits(str(set(SCREAMING_SNAKE_CASE__			) - set(SCREAMING_SNAKE_CASE__			)			)			)
		snake_case  :       Dict     			=						[
		    {'''expected''': expected_splits[name], '''recorded''': recorded_splits[name]}
		    for name in expected_splits
		    if expected_splits[name].num_examples != recorded_splits[name].num_examples
		]
		if len(SCREAMING_SNAKE_CASE__			) > 0:
				raise NonMatchingSplitsSizesError(str(SCREAMING_SNAKE_CASE__			)			)
		logger.info('''All the splits matched successfully.'''			)




def    _UpperCamelCase						(       SCREAMING_SNAKE_CASE__ ,       SCREAMING_SNAKE_CASE__ = True			)  ->							dict:


		'''simple docstring'''


		if record_checksum:
				snake_case  :       Any     			=						shaaaa()
				with open(SCREAMING_SNAKE_CASE__ ,       '''rb'''			) as f:
						for chunk in iter(lambda: f.read(1 << 20			) ,       B''''''			):
								m.update(SCREAMING_SNAKE_CASE__			)
						snake_case  :       Any     			=						m.hexdigest()
		else:
				snake_case  :       Tuple     			=						None
		return {"num_bytes": os.path.getsize(SCREAMING_SNAKE_CASE__			), "checksum": checksum}




def    _UpperCamelCase						(       SCREAMING_SNAKE_CASE__			)  ->							Dict:


		'''simple docstring'''


		if dataset_size and config.IN_MEMORY_MAX_SIZE:
				return dataset_size < config.IN_MEMORY_MAX_SIZE
		else:
				return False


