






from collections.abc import Sequence






def 							lowerCamelCase__ (       __lowerCamelCase     :	Sequence[float]    ,						__lowerCamelCase     :	bool = False						):
  if not arr:
    return 0

  __UpperCAmelCase				:      Optional[int]	 =    0 if allow_empty_subarrays else float("""-inf"""						)
  __UpperCAmelCase				:      Optional[int]	 =    0.0
  for num in arr:
    __UpperCAmelCase				:      str	 =    max(0 if allow_empty_subarrays else num    ,						curr_sum + num						)
    __UpperCAmelCase				:      Dict	 =    max(__lowerCamelCase    ,						__lowerCamelCase						)

  return max_sum


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

       testmod()

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





import fire

from utils import calculate_rouge, save_json
def 							__SCREAMING_SNAKE_CASE     (   a__    :   Any			,a__    :   Tuple			,a__    :   Any=None			,**a__    :   Dict       )					->				Optional[Any]:
	__A :			int		    =			[x.strip() for x in open(a__       ).readlines()]
	__A :			List[str]		    =			[x.strip() for x in open(a__       ).readlines()][: len(a__       )]
	__A :			List[Any]		    =			calculate_rouge(a__			,a__			,**a__       )
	if save_path is not None:
		save_json(a__			,a__			,indent=a__       )
	return metrics  # these print nicely


if __name__ == "__main__":
			fire.Fire(calculate_rouge_path)





