
from collections.abc import Sequence







def 						_snake_case(  SCREAMING_SNAKE_CASE__					,	SCREAMING_SNAKE_CASE__ = False				) ->    float:
       if not arr:
              return 0

       lowercase							:     Any       	=      0 if allow_empty_subarrays else float("""-inf"""				)
       lowercase							:     List[str]       	=      0.0
       for num in arr:
              lowercase							:     str       	=      max(0 if allow_empty_subarrays else num					,	curr_sum + num				)
              lowercase							:     List[Any]       	=      max(SCREAMING_SNAKE_CASE__					,	SCREAMING_SNAKE_CASE__				)

       return max_sum


if __name__ == "__main__":
  from doctest import testmod

  testmod()

  lowercase  :					Union[str, Any]						    =							[-2, 1, -3, 4, -1, 2, 1, -5, 4]
  print(F'''{max_subarray_sum(nums) = }''')








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					(       A__	):

				"""simple docstring"""




				def __init__(     self						:    Dict,  lowerCamelCase						:    pyspark.sql.DataFrame,  lowerCamelCase						:    Optional[NamedSplit] = None,  lowerCamelCase						:    Optional[Features] = None,  lowerCamelCase						:    bool = True,  lowerCamelCase						:    str = None,  lowerCamelCase						:    bool = False,  lowerCamelCase						:    str = None,  lowerCamelCase						:    bool = True,  lowerCamelCase						:    str = "arrow",  **lowerCamelCase						:    str,  ):

								'''simple docstring'''
								super().__init__(
								    split=lowerCamelCase,  features=lowerCamelCase,  cache_dir=lowerCamelCase,  keep_in_memory=lowerCamelCase,  streaming=lowerCamelCase,  **lowerCamelCase,  )
								lowercase__    =			load_from_cache_file
								lowercase__    =			file_format
								lowercase__    =			Spark(
								    df=lowerCamelCase,  features=lowerCamelCase,  cache_dir=lowerCamelCase,  working_dir=lowerCamelCase,  **lowerCamelCase,  )




				def 				lowercase__   (     self						:    List[Any]  ):

								'''simple docstring'''
								if self.streaming:
												return self.builder.as_streaming_dataset(split=self.split  )
								lowercase__    =			None if self._load_from_cache_file else DownloadMode.FORCE_REDOWNLOAD
								self.builder.download_and_prepare(
								    download_mode=lowerCamelCase,  file_format=self._file_format,  )
								return self.builder.as_dataset(split=self.split  )




