"""simple docstring"""
from collections.abc import Sequence





def    lowerCAmelCase__    (			_UpperCamelCase       :				Sequence[float] ,			_UpperCamelCase       :				bool = False					)					->				float:





						"""simple docstring"""






						if not arr:
												return 0

						snake_case								=			0 if allow_empty_subarrays else float('-inf'					)
						snake_case								=			0.0
						for num in arr:
												snake_case								=			max(0 if allow_empty_subarrays else num ,			curr_sum + num					)
												snake_case								=			max(_UpperCamelCase ,			_UpperCamelCase					)

						return max_sum


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

					testmod()

					SCREAMING_SNAKE_CASE__      						=  [-2, 1, -3, 4, -1, 2, 1, -5, 4]
					print(f"""{max_subarray_sum(nums) = }""")



"""simple docstring"""
from abc import ABC, abstractmethod
from typing import Optional, Union

from .. import Dataset, DatasetDict, Features, IterableDataset, IterableDatasetDict, NamedSplit
from ..utils.typing import NestedDataStructureLike, PathLike



class   lowerCAmelCase_    (			lowerCAmelCase					):



				"""simple docstring"""

				def __init__(				self		,    lowerCAmelCase = None		,    lowerCAmelCase = None		,    lowerCAmelCase = None		,    lowerCAmelCase = None		,    lowerCAmelCase = False		,    lowerCAmelCase = False		,    lowerCAmelCase = None		,    **lowerCAmelCase		,    ):






										"""simple docstring"""

										snake_case								=			path_or_paths
										snake_case								=			split if split or isinstance(lowerCAmelCase		,    lowerCAmelCase    ) else 'train'
										snake_case								=			features
										snake_case								=			cache_dir
										snake_case								=			keep_in_memory
										snake_case								=			streaming
										snake_case								=			num_proc
										snake_case								=			kwargs

				@abstractmethod
				def 		snake_case (				self    ):






										"""simple docstring"""

										pass





class   lowerCAmelCase_    (			lowerCAmelCase					):



				"""simple docstring"""

				def __init__(				self		,    lowerCAmelCase = None		,    lowerCAmelCase = None		,    lowerCAmelCase = False		,    lowerCAmelCase = False		,    lowerCAmelCase = None		,    **lowerCAmelCase		,    ):






										"""simple docstring"""

										snake_case								=			features
										snake_case								=			cache_dir
										snake_case								=			keep_in_memory
										snake_case								=			streaming
										snake_case								=			num_proc
										snake_case								=			kwargs

				@abstractmethod
				def 		snake_case (				self    ):






										"""simple docstring"""

										pass


