





'''simple docstring'''

import datasets


__lowerCAmelCase				:      List[str]						      ="\\n@InProceedings{conneau2018xnli,\n  author = \"Conneau, Alexis\n                 and Rinott, Ruty\n                 and Lample, Guillaume\n                 and Williams, Adina\n                 and Bowman, Samuel R.\n                 and Schwenk, Holger\n                 and Stoyanov, Veselin\",\n  title = \"XNLI: Evaluating Cross-lingual Sentence Representations\",\n  booktitle = \"Proceedings of the 2018 Conference on Empirical Methods\n               in Natural Language Processing\",\n  year = \"2018\",\n  publisher = \"Association for Computational Linguistics\",\n  location = \"Brussels, Belgium\",\n}\n"

__lowerCAmelCase				:      str						      ="\\nXNLI is a subset of a few thousand examples from MNLI which has been translated\ninto a 14 different languages (some low-ish resource). As with MNLI, the goal is\nto predict textual entailment (does sentence A imply/contradict/neither sentence\nB) and is a classification task (given two sentences, predict one of three\nlabels).\n"

__lowerCAmelCase				:      str						      ="\nComputes XNLI score which is just simple accuracy.\nArgs:\n    predictions: Predicted labels.\n    references: Ground truth labels.\nReturns:\n    'accuracy': accuracy\nExamples:\n\n    >>> predictions = [0, 1]\n    >>> references = [0, 1]\n    >>> xnli_metric = datasets.load_metric(\"xnli\")\n    >>> results = xnli_metric.compute(predictions=predictions, references=references)\n    >>> print(results)\n    {'accuracy': 1.0}\n"





def 		UpperCamelCase							(				_lowerCamelCase   :   Tuple		,			_lowerCamelCase   :   Optional[Any]			):
    return (preds == labels).mean()






@datasets.utils.file_utils.add_start_docstrings(_DESCRIPTION     ,			_KWARGS_DESCRIPTION							)
class   UpperCAmelCase      (			datasets.Metric							):
 def 	UpperCAmelCase_				(							self :str				)->				int:
     return datasets.MetricInfo(
         description=_DESCRIPTION		,			citation=_CITATION		,			inputs_description=_KWARGS_DESCRIPTION		,			features=datasets.Features(
             {
                 "predictions": datasets.Value("int64" if self.config_name != "sts-b" else "float32"				),
                 "references": datasets.Value("int64" if self.config_name != "sts-b" else "float32"				),
             }				)		,			codebase_urls=[]		,			reference_urls=[]		,			format="numpy"		,			)



 def 	UpperCAmelCase_				(							self :Tuple		,			lowercase_ :List[Any]		,			lowercase_ :Union[str, Any]				)->				Optional[int]:
     return {"accuracy": simple_accuracy(lowercase_		,			lowercase_				)}










'''simple docstring'''

from string import ascii_uppercase

__lowerCAmelCase				:      Union[str, Any]						      ={str(ord(c) - 55): c for c in ascii_uppercase}





def 		UpperCamelCase							(				_lowerCamelCase   :   int		,			_lowerCamelCase   :   int			):
    if isinstance(_lowerCamelCase		,			_lowerCamelCase			):
        raise TypeError("int() can't convert non-string with explicit base"			)
    if num < 0:
        raise ValueError("parameter must be positive int"			)
    if isinstance(_lowerCamelCase		,			_lowerCamelCase			):
        raise TypeError("'str' object cannot be interpreted as an integer"			)
    if isinstance(_lowerCamelCase		,			_lowerCamelCase			):
        raise TypeError("'float' object cannot be interpreted as an integer"			)
    if base in (0, 1):
        raise ValueError("base must be >= 2"			)
    if base > 36:
        raise ValueError("base must be <= 36"			)
    A__							=     ""
    A__							=     0
    A__							=     0
    while div != 1:
        A__,      A__							=     divmod(_lowerCamelCase		,			_lowerCamelCase			)
        if base >= 11 and 9 < mod < 36:
            A__							=     ALPHABET_VALUES[str(_lowerCamelCase			)]
        else:
            A__							=     str(_lowerCamelCase			)
        new_value += actual_value
        A__							=     num // base
        A__							=     div
        if div == 0:
            return str(new_value[::-1]			)
        elif div == 1:
            new_value += str(_lowerCamelCase			)
            return str(new_value[::-1]			)

    return new_value[::-1]


if __name__ == "__main__":
  import doctest

  doctest.testmod()

  for base in range(2, 37):
    for num in range(1000):
      assert int(decimal_to_any(num, base), base) == num, (
          num,
          base,
          decimal_to_any(num, base),
          int(decimal_to_any(num, base), base),
      )



