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







class  __A				( metaclass=_SCREAMING_SNAKE_CASE			):
 lowerCamelCase				       =['''transformers''', '''torch''', '''note_seq''']
 def __init__(   self			:    Optional[int]				,   *lowerCamelCase			:    str				,   **lowerCamelCase			:    Optional[Any]       ):



   """simple docstring"""





   requires_backends(self				,   ["""transformers""", """torch""", """note_seq"""]       )
 @classmethod
 def 		lowercase_(   cls			:    Any				,   *lowerCamelCase			:    List[str]				,   **lowerCamelCase			:    Optional[Any]       ):



   """simple docstring"""





   requires_backends(cls				,   ["""transformers""", """torch""", """note_seq"""]       )






 @classmethod
 def 		lowercase_(   cls			:    List[Any]				,   *lowerCamelCase			:    Optional[int]				,   **lowerCamelCase			:    Tuple       ):



   """simple docstring"""





   requires_backends(cls				,   ["""transformers""", """torch""", """note_seq"""]       )





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







def        A_     (						__SCREAMING_SNAKE_CASE						:  Sequence[float]			,     __SCREAMING_SNAKE_CASE						:  bool = False )				->       float:





  """simple docstring"""

  if not arr:
    return 0

  __A		:     Any												=		0 if allow_empty_subarrays else float("""-inf""" )
  __A		:     List[Any]												=		0.0
  for num in arr:
    __A		:     Tuple												=		max(0 if allow_empty_subarrays else num			,     curr_sum + num )
    __A		:     Optional[int]												=		max(__SCREAMING_SNAKE_CASE			,     __SCREAMING_SNAKE_CASE )

  return max_sum


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

     testmod()

     A__   :		Any 		=[-2, 1, -3, 4, -1, 2, 1, -5, 4]
     print(F"{max_subarray_sum(nums) = }")



