




import argparse
import json

from tqdm import tqdm







def 				lowerCAmelCase_	(     ):
      _A							:     str			=						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""",)
      _A							:     str			=						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:
            _A							:     List[Any]			=						json.load(snake_case_     )
            for dpr_record in tqdm(snake_case_     ):
                  _A							:     Union[str, Any]			=						dpr_record["""question"""]
                  _A							:     List[str]			=						[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()







from math import asin, atan, cos, radians, sin, sqrt, tan

_snake_case										=       6_3_7_8_1_3_7.0
_snake_case										=       6_3_5_6_7_5_2.3_1_4_2_4_5
_snake_case										=       6378137







def 				lowerCAmelCase_	(     snake_case_,snake_case_,snake_case_,snake_case_     ):
      _A							:     Any			=						(AXIS_A - AXIS_B) / AXIS_A
      _A							:     Optional[int]			=						atan((1 - flattening) * tan(radians(snake_case_     )     )     )
      _A							:     List[str]			=						atan((1 - flattening) * tan(radians(snake_case_     )     )     )
      _A							:     Optional[Any]			=						radians(snake_case_     )
      _A							:     str			=						radians(snake_case_     )
      # Equation
      _A							:     Dict			=						sin((phi_a - phi_a) / 2     )
      _A							:     List[str]			=						sin((lambda_a - lambda_a) / 2     )
      # Square both values
      sin_sq_phi *= sin_sq_phi
      sin_sq_lambda *= sin_sq_lambda
      _A							:     Optional[int]			=						sqrt(sin_sq_phi + (cos(snake_case_     ) * cos(snake_case_     ) * sin_sq_lambda)     )
      return 2 * RADIUS * asin(snake_case_     )


if __name__ == "__main__":
  import doctest

  doctest.testmod()

