


import math_equivalence  # From: git+https://github.com/hendrycks/math.git

import datasets


A			:						Union[str, Any]        =  '\\n@article{hendrycksmath2021,\n  title={Measuring Mathematical Problem Solving With the MATH Dataset},\n  author={Dan Hendrycks\n    and Collin Burns\n    and Saurav Kadavath\n    and Akul Arora\n    and Steven Basart\n    and Eric Tang\n    and Dawn Song\n    and Jacob Steinhardt},\n  journal={arXiv preprint arXiv:2103.03874},\n  year={2021}\n}\n'


A			:						int        =  '\\nThis metric is used to assess performance on the Mathematics Aptitude Test of Heuristics (MATH) dataset.\nIt first canonicalizes the inputs (e.g., converting "1/2" to "\\frac{1}{2}") and then computes accuracy.\n'


A			:						int        =  r'\nCalculates accuracy after canonicalizing inputs.\n\nArgs:\n    predictions: list of predictions to score. Each prediction\n        is a string that contains natural language and LaTex.\n    references: list of reference for each prediction. Each\n        reference is a string that contains natural language\n        and LaTex.\nReturns:\n    accuracy: accuracy after canonicalizing inputs\n        (e.g., converting "1/2" to "\\frac{1}{2}")\n\nExamples:\n    >>> metric = datasets.load_metric("competition_math")\n    >>> results = metric.compute(references=["\\frac{1}{2}"], predictions=["1/2"])\n    >>> print(results)\n    {\'accuracy\': 1.0}\n'



@datasets.utils.file_utils.add_end_docstrings(_DESCRIPTION					,    _KWARGS_DESCRIPTION				)
class 				A       (			datasets.Metric				):
					'''simple docstring'''






					def     lowerCamelCase__	(self       :		List[Any]						)		->  Union[str, Any]:




							"""simple docstring"""


							return datasets.MetricInfo(
							    description=_DESCRIPTION ,   citation=_CITATION ,   inputs_description=_KWARGS_DESCRIPTION ,   features=datasets.Features(
							        {
							            """predictions""": datasets.Value("""string"""						),
							            """references""": datasets.Value("""string"""						),
							        }						) ,   homepage="""https://github.com/hendrycks/math""" ,   codebase_urls=["""https://github.com/hendrycks/math"""] ,   )


					def     lowerCamelCase__	(self       :		Any ,   _UpperCAmelCase       :		str ,   _UpperCAmelCase       :		Any						)		->  Any:




							"""simple docstring"""


							lowercase__	     =						0.0
							for i, j in zip(_UpperCAmelCase ,   _UpperCAmelCase						):
									n_correct += 1.0 if math_equivalence.is_equiv(_UpperCAmelCase ,   _UpperCAmelCase						) else 0.0
							lowercase__	     =						n_correct / len(_UpperCAmelCase						)
							return {
							    "accuracy": accuracy,
							}



"""simple docstring"""






def      lowerCAmelCase__			(		__magic_name__ = 1_0      )						->str:
			if not isinstance(__magic_name__			,   __magic_name__      ) or n < 0:
						raise ValueError("Invalid input"      )
			__lowercase       =       1_0**n
			__lowercase       =       2_8_4_3_3 * (pow(2			,   7_8_3_0_4_5_7			,   __magic_name__      )) + 1
			return str(number % modulus      )


if __name__ == "__main__":
					from doctest import testmod

					testmod()
					print(F"{solution(10) = }")





