





"""simple docstring"""






from collections.abc import Sequence

def       __lowerCamelCase    (       SCREAMING_SNAKE_CASE,SCREAMING_SNAKE_CASE = False							)		->       float:






							"""simple docstring"""




							if not arr:
														return 0

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

							return max_sum


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

				testmod()

				lowerCAmelCase_			=							[-2, 1, -3, 4, -1, 2, 1, -5, 4]
				print(F'''{max_subarray_sum(nums) = }''')













"""simple docstring"""






def       __lowerCamelCase    (       SCREAMING_SNAKE_CASE,SCREAMING_SNAKE_CASE							)		->       int:






       """simple docstring"""




       return number | (1 << position)

def       __lowerCamelCase    (       SCREAMING_SNAKE_CASE,SCREAMING_SNAKE_CASE							)		->       int:






       """simple docstring"""




       return number & ~(1 << position)

def       __lowerCamelCase    (       SCREAMING_SNAKE_CASE,SCREAMING_SNAKE_CASE							)		->       int:






       """simple docstring"""




       return number ^ (1 << position)

def       __lowerCamelCase    (       SCREAMING_SNAKE_CASE,SCREAMING_SNAKE_CASE							)		->       bool:






       """simple docstring"""




       return ((number >> position) & 1) == 1

def       __lowerCamelCase    (       SCREAMING_SNAKE_CASE,SCREAMING_SNAKE_CASE							)		->       int:






       """simple docstring"""




       return int((number & (1 << position)) != 0							)


if __name__ == "__main__":
    import doctest

    doctest.testmod()






