





'''simple docstring'''


import argparse
import json

from tqdm import tqdm
def       __snake_case		( )							->     str:

       """simple docstring"""


       UpperCAmelCase  =						argparse.ArgumentParser()

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


if __name__ == "__main__":
    main()



'''simple docstring'''


def   A_      (       SCREAMING_SNAKE_CASE_						)			->bool:
  if num < 0:
    return False

  lowercase_     =       num
  lowercase_     =       0
  while num > 0:
    lowercase_     =       rev_num * 10 + (num % 10)
    num //= 10

  return num_copy == rev_num


if __name__ == "__main__":
       import doctest

       doctest.testmod()

