



from collections.abc import Sequence


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

		lowerCAmelCase_			:     Tuple									= 0 if allow_empty_subarrays else float('''-inf''' )
		lowerCAmelCase_			:     Optional[Any]									= 0.0
		for num in arr:
				lowerCAmelCase_			:     Union[str, Any]									= max(0 if allow_empty_subarrays else num     ,curr_sum + num )
				lowerCAmelCase_			:     List[Any]									= max(__UpperCamelCase     ,__UpperCamelCase )

		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) = }''')










import argparse
import json

from tqdm import tqdm
def 		UpperCamelCase	(   )	->     Optional[int]:
   UpperCamelCase    :  List[Any]							=	argparse.ArgumentParser()

   # Required parameters
   parser.add_argument(
       '--src_path'       ,     type=snake_case__       ,     default='biencoder-nq-dev.json'       ,     help='Path to raw DPR training data'       ,     )
   parser.add_argument(
       '--evaluation_set'       ,     type=snake_case__       ,     help='where to store parsed evaluation_set file'       ,     )
   parser.add_argument(
       '--gold_data_path'       ,     type=snake_case__       ,     help='where to store parsed gold_data_path file'       ,     )
   UpperCamelCase    :  int							=	parser.parse_args()

   with open(args.src_path       ,     'r'	) as src_file, open(args.evaluation_set       ,     'w'	) as eval_file, open(
       args.gold_data_path       ,     'w'	) as gold_file:
      UpperCamelCase    :  int							=	json.load(snake_case__	)
      for dpr_record in tqdm(snake_case__	):
         UpperCamelCase    :  Union[str, Any]							=	dpr_record['question']
         UpperCamelCase    :  Dict							=	[context['title'] for context in dpr_record['positive_ctxs']]
         eval_file.write(question + '\n'	)
         gold_file.write('\t'.join(snake_case__	) + '\n'	)


if __name__ == "__main__":
    main()



