import argparse
import json

from tqdm import tqdm
def       __magic_name__(  )						->    List[str]:



      '''simple docstring'''

      _lowerCamelCase			    =				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''' ,						)
      _lowerCamelCase			    =				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:
            _lowerCamelCase			    =				json.load(__UpperCAmelCase		)
            for dpr_record in tqdm(__UpperCAmelCase		):
                  _lowerCamelCase			    =				dpr_record['''question''']
                  _lowerCamelCase			    =				[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()
def       __magic_name__(  __UpperCAmelCase ,						__UpperCAmelCase		)						->    bool:



      '''simple docstring'''

      _lowerCamelCase			    =				len(__UpperCAmelCase		)
      _lowerCamelCase			    =				[[False] * (required_sum + 1) for _ in range(arr_len + 1		)]

      # for each arr value, a sum of zero(0) can be formed by not taking any element
      # hence True/1
      for i in range(arr_len + 1		):
            _lowerCamelCase			    =				True

      # sum is not zero and set is empty then false
      for i in range(1 ,						required_sum + 1		):
            _lowerCamelCase			    =				False

      for i in range(1 ,						arr_len + 1		):
            for j in range(1 ,						required_sum + 1		):
                  if arr[i - 1] > j:
                        _lowerCamelCase			    =				subset[i - 1][j]
                  if arr[i - 1] <= j:
                        _lowerCamelCase			    =				subset[i - 1][j] or subset[i - 1][j - arr[i - 1]]

      return subset[arr_len][required_sum]


if __name__ == "__main__":
     import doctest

     doctest.testmod()