






"""simple docstring"""



import os
def 						_SCREAMING_SNAKE_CASE (    ):





  '''simple docstring'''





  lowercase							    =       os.path.dirname(os.path.realpath(__snake_case    )    )
  lowercase							    =       os.path.join(__snake_case		,					'triangle.txt'    )

  with open(__snake_case    ) as f:
    lowercase							    =       f.readlines()

  lowercase							    =       []
  for line in triangle:
    lowercase							    =       []
    for number in line.strip().split(' '    ):
      numbers_from_line.append(int(__snake_case    )    )
    a.append(__snake_case    )

  for i in range(1		,					len(__snake_case    )    ):
    for j in range(len(a[i]    )    ):
      lowercase							    =       a[i - 1][j] if j != len(a[i - 1]    ) else 0
      lowercase							    =       a[i - 1][j - 1] if j > 0 else 0
      a[i][j] += max(__snake_case		,					__snake_case    )
  return max(a[-1]    )


if __name__ == "__main__":
    print(solution())










"""simple docstring"""



import argparse
import json

from tqdm import tqdm
def 						_SCREAMING_SNAKE_CASE (    ):





  '''simple docstring'''





  lowercase							    =       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'		,					)
  lowercase							    =       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:
    lowercase							    =       json.load(__snake_case    )
    for dpr_record in tqdm(__snake_case    ):
      lowercase							    =       dpr_record['question']
      lowercase							    =       [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()


