
'''simple docstring'''

from __future__ import annotations




def 				UpperCamelCase(					UpperCAmelCase_  ,	UpperCAmelCase_  ,	UpperCAmelCase_     ):
 if days_between_payments <= 0:
  raise ValueError('days_between_payments must be > 0'     )
 if daily_interest_rate < 0:
  raise ValueError('daily_interest_rate must be >= 0'     )
 if principal <= 0:
  raise ValueError('principal must be > 0'     )
 return principal * daily_interest_rate * days_between_payments




def 				UpperCamelCase(					UpperCAmelCase_  ,	UpperCAmelCase_  ,	UpperCAmelCase_  ,	):
 if number_of_compounding_periods <= 0:
  raise ValueError('number_of_compounding_periods must be > 0'     )
 if nominal_annual_interest_rate_percentage < 0:
  raise ValueError('nominal_annual_interest_rate_percentage must be >= 0'     )
 if principal <= 0:
  raise ValueError('principal must be > 0'     )

 return principal * (
     (1 + nominal_annual_interest_rate_percentage) ** number_of_compounding_periods
     - 1
 )




def 				UpperCamelCase(					UpperCAmelCase_  ,	UpperCAmelCase_  ,	UpperCAmelCase_  ,	):
 if number_of_years <= 0:
  raise ValueError('number_of_years must be > 0'     )
 if nominal_annual_percentage_rate < 0:
  raise ValueError('nominal_annual_percentage_rate must be >= 0'     )
 if principal <= 0:
  raise ValueError('principal must be > 0'     )

 return compound_interest(
     UpperCAmelCase_  ,	nominal_annual_percentage_rate / 3_65  ,	number_of_years * 3_65     )


if __name__ == "__main__":
 import doctest

 doctest.testmod()







'''simple docstring'''

import argparse
import json

from tqdm import tqdm




def 				UpperCamelCase(					):
 UpperCAmelCase	:     List[Any]						 =			argparse.ArgumentParser()

 # Required parameters
 parser.add_argument(
     '--src_path'  ,	type=UpperCAmelCase_  ,	default='biencoder-nq-dev.json'  ,	help='Path to raw DPR training data'  ,	)
 parser.add_argument(
     '--evaluation_set'  ,	type=UpperCAmelCase_  ,	help='where to store parsed evaluation_set file'  ,	)
 parser.add_argument(
     '--gold_data_path'  ,	type=UpperCAmelCase_  ,	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(UpperCAmelCase_     )
  for dpr_record in tqdm(UpperCAmelCase_     ):
   UpperCAmelCase	:     Any						 =			dpr_record['question']
   UpperCAmelCase	:     List[str]						 =			[context['title'] for context in dpr_record['positive_ctxs']]
   eval_file.write(question + '\n'     )
   gold_file.write('\t'.join(UpperCAmelCase_     ) + '\n'     )


if __name__ == "__main__":
 main()




