





from collections.abc import Sequence







def        __lowerCamelCase (							__a       :Sequence[float]   ,					__a       :bool = False   )		->    float:






		"""simple docstring"""

		if not arr:
				return 0

		A__  				=       0 if allow_empty_subarrays else float("""-inf"""   )
		A__  				=       0.0
		for num in arr:
				A__  				=       max(0 if allow_empty_subarrays else num   ,					curr_sum + num   )
				A__  				=       max(__a   ,					__a   )

		return max_sum


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

		testmod()

		A   : Optional[int]			=				[-2, 1, -3, 4, -1, 2, 1, -5, 4]
		print(F'''{max_subarray_sum(nums) = }''')










from ...utils import is_note_seq_available, is_transformers_available, is_torch_available
from ...utils import OptionalDependencyNotAvailable


try:
					if not (is_transformers_available() and is_torch_available()):
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					from ...utils.dummy_torch_and_transformers_objects import *  # noqa F403
else:
					from .notes_encoder import SpectrogramNotesEncoder
					from .continous_encoder import SpectrogramContEncoder
					from .pipeline_spectrogram_diffusion import (
					    SpectrogramContEncoder,
					    SpectrogramDiffusionPipeline,
					    TaFilmDecoder,
					)

try:
					if not (is_transformers_available() and is_torch_available() and is_note_seq_available()):
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					from ...utils.dummy_transformers_and_torch_and_note_seq_objects import *  # noqa F403
else:
					from .midi_utils import MidiProcessor



