



"""simple docstring"""




from typing import Optional

import pyspark

from .. import Features, NamedSplit
from ..download import DownloadMode
from ..packaged_modules.spark.spark import Spark
from .abc import AbstractDatasetReader






class       UpperCAmelCase_    (							_UpperCamelCase		):



      def __init__(	self	:      Optional[Any]	,      A	:      pyspark.sql.DataFrame	,      A	:      Optional[NamedSplit] = None	,      A	:      Optional[Features] = None	,      A	:      bool = True	,      A	:      str = None	,      A	:      bool = False	,      A	:      str = None	,      A	:      bool = True	,      A	:      str = "arrow"	,      **A	:      Optional[int]	,      ):
           super().__init__(
               split=A	,      features=A	,      cache_dir=A	,      keep_in_memory=A	,      streaming=A	,      **A	,      )
           _UpperCAmelCase     :      Dict														=       load_from_cache_file
           _UpperCAmelCase     :      Any														=       file_format
           _UpperCAmelCase     :      Any														=       Spark(
               df=A	,      features=A	,      cache_dir=A	,      working_dir=A	,      **A	,      )



      def 		snake_case_   (	self	:      Union[str, Any]		):
           if self.streaming:
                return self.builder.as_streaming_dataset(split=self.split		)
           _UpperCAmelCase     :      Tuple														=       None if self._load_from_cache_file else DownloadMode.FORCE_REDOWNLOAD
           self.builder.download_and_prepare(
               download_mode=A	,      file_format=self._file_format	,      )
           return self.builder.as_dataset(split=self.split		)





"""simple docstring"""




def 		__snake_case		( SCREAMING_SNAKE_CASE__      :		str							)    ->  bool:





     '''simple docstring'''

     _UpperCAmelCase     :      str														=       0
     for ch in input_str:
          _UpperCAmelCase     :      Optional[int]														=       ord(SCREAMING_SNAKE_CASE__							)
          _UpperCAmelCase     :      int														=       pow(2		,    SCREAMING_SNAKE_CASE__							)

          # If we already turned on bit for current character's unicode
          if bitmap >> ch_unicode & 1 == 1:
               return False
          bitmap |= ch_bit_index_on
     return True


if __name__ == "__main__":
 import doctest

 doctest.testmod()
