


from collections.abc import Sequence







def SCREAMING_SNAKE_CASE	(			__lowerCAmelCase							,   __lowerCAmelCase = False				)    ->				float:
  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(__lowerCAmelCase							,   __lowerCAmelCase				)

  return max_sum


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

   testmod()

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





"""simple docstring"""

from typing import Optional
from urllib.parse import quote

import huggingface_hub as hfh
from packaging import version


def lowerCAmelCase_   (					UpperCamelCase__						:			str					, UpperCamelCase__						:			str					, UpperCamelCase__						:			Optional[str] = None			):






 """simple docstring"""







 if version.parse(hfh.__version__			).release < version.parse("""0.11.0"""			).release:
  # old versions of hfh don't url-encode the file path
  __lowercase						=						quote(UpperCamelCase__			)
 return hfh.hf_hub_url(UpperCamelCase__					, UpperCamelCase__					, repo_type="""dataset"""					, revision=UpperCamelCase__			)
