import datasets


_lowercase:	str       			=		'''\
@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:	Dict       			=		'''\
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:	List[str]       			=		'''
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 _lowerCamelCase  (		snake_case     , snake_case  ):
							return (preds == labels).mean()



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





			def   SCREAMING_SNAKE_CASE__     (       self	:	Dict						):
										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	:	Union[str, Any]  ,  lowercase__	:	Dict  ,  lowercase__	:	Dict						):
										return {"accuracy": simple_accuracy(lowercase__  ,  lowercase__						)}







import functools






def _lowerCamelCase  (		snake_case     , snake_case  ):

							# Validation
							if not isinstance(snake_case     , snake_case  ) or not all(isinstance(snake_case     , snake_case  ) for day in days  ):
														raise ValueError('The parameter days should be a list of integers'  )

							if len(snake_case  ) != 3 or not all(isinstance(snake_case     , snake_case  ) for cost in costs  ):
														raise ValueError('The parameter costs should be a list of three integers'  )

							if len(snake_case  ) == 0:
														return 0

							if min(snake_case  ) <= 0:
														raise ValueError('All days elements should be greater than 0'  )

							if max(snake_case  ) >= 366:
														raise ValueError('All days elements should be less than 366'  )

							_lowerCAmelCase							=							set(snake_case  )

							@functools.cache
							def dynamic_programming(snake_case  ) -> int:
														if index > 365:
																					return 0

														if index not in days_set:
																					return dynamic_programming(index + 1  )

														return min(
														    costs[0] + dynamic_programming(index + 1  )     , costs[1] + dynamic_programming(index + 7  )     , costs[2] + dynamic_programming(index + 30  )     , )

							return dynamic_programming(1  )


if __name__ == "__main__":
				import doctest

				doctest.testmod()






