




'''simple docstring'''



import argparse
from collections import defaultdict




def   lowercase__(			__UpperCamelCase:					Union[str, Any]      ,__UpperCamelCase:					List[str]      ,__UpperCamelCase:					Tuple      ,__UpperCamelCase:					str      ,__UpperCamelCase:					Optional[Any]    ):

      """simple docstring"""






      SCREAMING_SNAKE_CASE   :      Any    					=						f"{file}_{class_name}_{test_name}"
      done_test[_id] += 1

      with open(__UpperCamelCase      ,'r'    ) as f:
            SCREAMING_SNAKE_CASE   :      Union[str, Any]    					=						f.readlines()

      SCREAMING_SNAKE_CASE   :      Optional[int]    					=						f"class {class_name}("
      SCREAMING_SNAKE_CASE   :      Union[str, Any]    					=						f"{4 * ' '}def {test_name}("
      SCREAMING_SNAKE_CASE   :      int    					=						f"{8 * ' '}{correct_line.split()[0]}"
      SCREAMING_SNAKE_CASE   :      Optional[Any]    					=						f"{16 * ' '}{correct_line.split()[0]}"
      SCREAMING_SNAKE_CASE   :      Any    					=						False
      SCREAMING_SNAKE_CASE   :      Dict    					=						False
      SCREAMING_SNAKE_CASE   :      int    					=						False
      SCREAMING_SNAKE_CASE   :      List[Any]    					=						False
      SCREAMING_SNAKE_CASE   :      Union[str, Any]    					=						0
      SCREAMING_SNAKE_CASE   :      Tuple    					=						0

      SCREAMING_SNAKE_CASE   :      List[Any]    					=						[]
      for line in lines:
            if line.startswith(__UpperCamelCase    ):
                  SCREAMING_SNAKE_CASE   :      Tuple    					=						True
            elif in_class and line.startswith(__UpperCamelCase    ):
                  SCREAMING_SNAKE_CASE   :      str    					=						True
            elif in_class and in_func and (line.startswith(__UpperCamelCase    ) or line.startswith(__UpperCamelCase    )):
                  SCREAMING_SNAKE_CASE   :      Any    					=						len(line.split(correct_line.split()[0]    )[0]    )
                  count += 1

                  if count == done_test[_id]:
                        SCREAMING_SNAKE_CASE   :      Union[str, Any]    					=						True

            if in_class and in_func and in_line:
                  if ")" not in line:
                        continue
                  else:
                        SCREAMING_SNAKE_CASE   :      str    					=						True

            if in_class and in_func and in_line and insert_line:
                  new_lines.append(f"{spaces * ' '}{correct_line}"    )
                  SCREAMING_SNAKE_CASE   :      Optional[Any]    					=						False
            else:
                  new_lines.append(__UpperCamelCase    )

      with open(__UpperCamelCase      ,'w'    ) as f:
            for line in new_lines:
                  f.write(__UpperCamelCase    )




def   lowercase__(			__UpperCamelCase:					List[str]      ,__UpperCamelCase:					List[Any]=None    ):

      """simple docstring"""






      if fail is not None:
            with open(__UpperCamelCase      ,'r'    ) as f:
                  SCREAMING_SNAKE_CASE   :      Union[str, Any]    					=						{l.strip() for l in f.readlines()}
      else:
            SCREAMING_SNAKE_CASE   :      Union[str, Any]    					=						None

      with open(__UpperCamelCase      ,'r'    ) as f:
            SCREAMING_SNAKE_CASE   :      List[Any]    					=						f.readlines()

      SCREAMING_SNAKE_CASE   :      Union[str, Any]    					=						defaultdict(__UpperCamelCase    )
      for line in correct_lines:
            SCREAMING_SNAKE_CASE					,    SCREAMING_SNAKE_CASE					,    SCREAMING_SNAKE_CASE					,    SCREAMING_SNAKE_CASE   :      Optional[Any]    					=						line.split(';'    )
            if test_failures is None or "::".join([file, class_name, test_name]    ) in test_failures:
                  overwrite_file(__UpperCamelCase      ,__UpperCamelCase      ,__UpperCamelCase      ,__UpperCamelCase      ,__UpperCamelCase    )


if __name__ == "__main__":
      UpperCamelCase_    	=				argparse.ArgumentParser()
      parser.add_argument("--correct_filename", help="filename of tests with expected result")
      parser.add_argument("--fail_filename", help="filename of test failures", type=str, default=None)
      UpperCamelCase_    	=				parser.parse_args()

      main(args.correct_filename, args.fail_filename)



'''simple docstring'''


from collections.abc import Sequence





def    lowerCAmelCase       (		UpperCamelCase__					: Sequence[float]     ,       UpperCamelCase__					: bool = False							):


	"""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(UpperCamelCase__     ,       UpperCamelCase__							)

	return max_sum


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

					testmod()

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