
"""simple docstring"""


import datasets


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

_lowercase							      = '''\
XNLI is a subset of a few thousand examples from MNLI which has been translated
into a 14 different languages (some low-ish resource). As with MNLI, the goal is
to predict textual entailment (does sentence A imply/contradict/neither sentence
B) and is a classification task (given two sentences, predict one of three
labels).
'''

_lowercase							      = '''
Computes XNLI score which is just simple accuracy.
Args:
    predictions: Predicted labels.
    references: Ground truth labels.
Returns:
    \'accuracy\': accuracy
Examples:

    >>> predictions = [0, 1]
    >>> references = [0, 1]
    >>> xnli_metric = datasets.load_metric("xnli")
    >>> results = xnli_metric.compute(predictions=predictions, references=references)
    >>> print(results)
    {\'accuracy\': 1.0}
'''






def 					_snake_case (						snake_case__      :   Dict		,					snake_case__      :   List[str]   ):
	return (preds == labels).mean()







@datasets.utils.file_utils.add_start_docstrings(_DESCRIPTION						,    _KWARGS_DESCRIPTION			)
class  lowerCAmelCase_ (					datasets.Metric			):



						'''simple docstring'''


						def   _SCREAMING_SNAKE_CASE					(       self   :					Optional[int]					)   ->      Optional[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   _SCREAMING_SNAKE_CASE					(       self   :					Any     ,A_   :					Tuple     ,A_   :					Union[str, Any]					)   ->      Optional[Any]:
							return {"accuracy": simple_accuracy(A_     ,A_					)}




"""simple docstring"""

from __future__ import annotations




def __lowercase			(							_a		,			_a		,			_a		,			):
    if (stress, tangential_force, area).count(0    ) != 1:
        raise ValueError('''You cannot supply more or less than 2 values'''    )
    elif stress < 0:
        raise ValueError('''Stress cannot be negative'''    )
    elif tangential_force < 0:
        raise ValueError('''Tangential Force cannot be negative'''    )
    elif area < 0:
        raise ValueError('''Area cannot be negative'''    )
    elif stress == 0:
        return (
            "stress",
            tangential_force / area,
        )
    elif tangential_force == 0:
        return (
            "tangential_force",
            stress * area,
        )
    else:
        return (
            "area",
            tangential_force / stress,
        )


if __name__ == "__main__":
     import doctest

     doctest.testmod()





