



"""simple docstring"""
import tempfile
import unittest

from transformers import TaConfig, is_torch_available
from transformers.testing_utils import (
    require_sentencepiece,
    require_tokenizers,
    require_torch,
    slow,
    torch_device,
)

from ...generation.test_utils import GenerationTesterMixin
from ...test_modeling_common import ModelTesterMixin, ids_tensor
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
					import torch

					from transformers import AutoTokenizer, UMTaForConditionalGeneration, UMTaForQuestionAnswering, UMTaModel




class       snake_case_    :






							def __init__( self      ,  a_      ,  a_=9_9      ,  a_=1_3      ,  a_=7      ,  a_=9      ,  a_=True      ,  a_=True      ,  a_=False      ,  a_=3_2      ,  a_=5      ,  a_=4      ,  a_=3_7      ,  a_=8      ,  a_=0.1      ,  a_=0.002      ,  a_=1      ,  a_=0      ,  a_=0      ,  a_=None      ,  a_=None      ,  ):
									a_  :   Tuple			    =  parent
									a_  :   List[str]			    =  batch_size
									a_  :   Union[str, Any]			    =  encoder_seq_length
									a_  :   Optional[Any]			    =  decoder_seq_length
									# For common tests
									a_  :   Union[str, Any]			    =  self.decoder_seq_length
									a_  :   Any			    =  is_training
									a_  :   Optional[Any]			    =  use_attention_mask
									a_  :   Optional[int]			    =  use_labels
									a_  :   Optional[int]			    =  vocab_size
									a_  :   Tuple			    =  hidden_size
									a_  :   Tuple			    =  num_hidden_layers
									a_  :   Optional[Any]			    =  num_attention_heads
									a_  :   List[Any]			    =  d_ff
									a_  :   str			    =  relative_attention_num_buckets
									a_  :   Optional[int]			    =  dropout_rate
									a_  :   Any			    =  initializer_factor
									a_  :   Union[str, Any]			    =  eos_token_id
									a_  :   str			    =  pad_token_id
									a_  :   int			    =  decoder_start_token_id
									a_  :   List[Any]			    =  None
									a_  :   List[Any]			    =  decoder_layers






							def snake_case_	( self   ):
									return TaConfig.from_pretrained("google/umt5-base"   )






							def snake_case_	( self      ,  a_      ,  a_      ,  a_      ,  a_=None      ,  a_=None      ,  a_=None      ,  a_=None      ,  a_=None      ,  ):
									if attention_mask is None:
											a_  :   Union[str, Any]			    =  input_ids.ne(config.pad_token_id   )
									if decoder_attention_mask is None:
											a_  :   Optional[int]			    =  decoder_input_ids.ne(config.pad_token_id   )
									if head_mask is None:
											a_  :   Tuple			    =  torch.ones(config.num_hidden_layers      ,  config.num_attention_heads      ,  device=__SCREAMING_SNAKE_CASE   )
									if decoder_head_mask is None:
											a_  :   str			    =  torch.ones(config.num_decoder_layers      ,  config.num_attention_heads      ,  device=__SCREAMING_SNAKE_CASE   )
									if cross_attn_head_mask is None:
											a_  :   Any			    =  torch.ones(
											    config.num_decoder_layers      ,  config.num_attention_heads      ,  device=__SCREAMING_SNAKE_CASE   )
									return {
									    "input_ids": input_ids,
									    "decoder_input_ids": decoder_input_ids,
									    "attention_mask": attention_mask,
									    "decoder_attention_mask": decoder_attention_mask,
									    "head_mask": head_mask,
									    "decoder_head_mask": decoder_head_mask,
									    "cross_attn_head_mask": cross_attn_head_mask,
									}






							def snake_case_	( self   ):
									a_  :   Optional[int]			    =  ids_tensor([self.batch_size, self.encoder_seq_length]      ,  self.vocab_size   )
									a_  :   Any			    =  ids_tensor([self.batch_size, self.decoder_seq_length]      ,  self.vocab_size   )

									# we need to clamp the input ids here to avoid having pad token in between
									# this is because for NllbMoe the position_ids are prepared such that
									# all pad tokens have pos id = 2 and rest are between 2..seq_length
									# and the seq_length here is seq_length - num_pad_tokens
									# but when using past, there is no way of knowing if the past input ids had
									# pad tokens in them, which results in incorrect seq_lenth and which in turn results in
									# position_ids being off by num_pad_tokens in past input
									a_  :   Any			    =  input_ids.clamp(self.pad_token_id + 1   )
									a_  :   Optional[Any]			    =  decoder_input_ids.clamp(self.pad_token_id + 1   )

									a_  :   Optional[Any]			    =  self.get_config()
									a_  :   List[Any]			    =  config.num_attention_heads
									a_  :   List[str]			    =  self.prepare_inputs_dict(__SCREAMING_SNAKE_CASE      ,  __SCREAMING_SNAKE_CASE      ,  __SCREAMING_SNAKE_CASE   )
									return config, input_dict






							def snake_case_	( self   ):
									a_    ,					a_  :   List[str]			    =  self.prepare_config_and_inputs()
									return config, inputs_dict






							def snake_case_	( self   ):
									return TaConfig(
									    vocab_size=1_6_6      ,  d_model=self.hidden_size      ,  d_ff=self.d_ff      ,  d_kv=self.hidden_size // self.num_attention_heads      ,  num_layers=self.num_hidden_layers      ,  num_decoder_layers=self.decoder_layers      ,  num_heads=self.num_attention_heads      ,  relative_attention_num_buckets=self.relative_attention_num_buckets      ,  dropout_rate=self.dropout_rate      ,  initializer_factor=self.initializer_factor      ,  eos_token_id=self.eos_token_id      ,  bos_token_id=self.pad_token_id      ,  pad_token_id=self.pad_token_id      ,  decoder_start_token_id=self.decoder_start_token_id      ,  )






							def snake_case_	( self   ):
									return TaConfig(
									    vocab_size=self.vocab_size      ,  d_model=self.hidden_size      ,  d_ff=self.d_ff      ,  d_kv=self.hidden_size // self.num_attention_heads      ,  num_layers=self.num_hidden_layers      ,  num_decoder_layers=self.decoder_layers      ,  num_heads=self.num_attention_heads      ,  relative_attention_num_buckets=self.relative_attention_num_buckets      ,  dropout_rate=self.dropout_rate      ,  initializer_factor=self.initializer_factor      ,  eos_token_id=self.eos_token_id      ,  bos_token_id=self.pad_token_id      ,  pad_token_id=self.pad_token_id      ,  decoder_start_token_id=self.decoder_start_token_id      ,  )






							def snake_case_	( self      ,  a_      ,  a_      ,  a_      ,  a_      ,  a_      ,  a_      ,  ):
									a_  :   int			    =  UMTaModel(config=__SCREAMING_SNAKE_CASE   )
									model.to(__SCREAMING_SNAKE_CASE   )
									model.eval()
									a_  :   Union[str, Any]			    =  model(
									    input_ids=__SCREAMING_SNAKE_CASE      ,  decoder_input_ids=__SCREAMING_SNAKE_CASE      ,  attention_mask=__SCREAMING_SNAKE_CASE      ,  decoder_attention_mask=__SCREAMING_SNAKE_CASE      ,  )
									a_  :   str			    =  model(input_ids=__SCREAMING_SNAKE_CASE      ,  decoder_input_ids=__SCREAMING_SNAKE_CASE   )
									a_  :   List[str]			    =  result.last_hidden_state
									a_  :   Any			    =  result.past_key_values
									a_  :   List[str]			    =  result.encoder_last_hidden_state

									self.parent.assertEqual(encoder_output.size()      ,  (self.batch_size, self.encoder_seq_length, self.hidden_size)   )
									self.parent.assertEqual(decoder_output.size()      ,  (self.batch_size, self.decoder_seq_length, self.hidden_size)   )
									# There should be `num_layers` key value embeddings stored in decoder_past
									self.parent.assertEqual(len(__SCREAMING_SNAKE_CASE   )      ,  config.num_layers   )
									# There should be a self attn key, a self attn value, a cross attn key and a cross attn value stored in each decoder_past tuple
									self.parent.assertEqual(len(decoder_past[0]   )      ,  4   )






							def snake_case_	( self      ,  a_      ,  a_      ,  a_      ,  a_      ,  a_      ,  a_      ,  ):
									a_  :   Tuple			    =  UMTaModel(config=__SCREAMING_SNAKE_CASE   ).get_decoder().to(__SCREAMING_SNAKE_CASE   ).eval()
									# first forward pass
									a_  :   int			    =  model(__SCREAMING_SNAKE_CASE      ,  use_cache=__SCREAMING_SNAKE_CASE   )
									a_  :   int			    =  model(__SCREAMING_SNAKE_CASE   )
									a_  :   Optional[Any]			    =  model(__SCREAMING_SNAKE_CASE      ,  use_cache=__SCREAMING_SNAKE_CASE   )

									self.parent.assertTrue(len(__SCREAMING_SNAKE_CASE   ) == len(__SCREAMING_SNAKE_CASE   )   )
									self.parent.assertTrue(len(__SCREAMING_SNAKE_CASE   ) == len(__SCREAMING_SNAKE_CASE   ) + 1   )

									a_    ,					a_  :   int			    =  outputs.to_tuple()

									# create hypothetical next token and extent to next_input_ids
									a_  :   Any			    =  ids_tensor((self.batch_size, 1)      ,  config.vocab_size   )

									# append to next input_ids and
									a_  :   Dict			    =  torch.cat([input_ids, next_tokens]      ,  dim=-1   )

									a_  :   Optional[int]			    =  model(__SCREAMING_SNAKE_CASE   )["last_hidden_state"]
									a_  :   Dict			    =  model(__SCREAMING_SNAKE_CASE      ,  past_key_values=__SCREAMING_SNAKE_CASE   )["last_hidden_state"]

									# select random slice
									a_  :   str			    =  ids_tensor((1,)      ,  output_from_past.shape[-1]   ).item()
									a_  :   Tuple			    =  output_from_no_past[:, -1, random_slice_idx].detach()
									a_  :   int			    =  output_from_past[:, 0, random_slice_idx].detach()

									# test that outputs are equal for slice
									self.parent.assertTrue(torch.allclose(__SCREAMING_SNAKE_CASE      ,  __SCREAMING_SNAKE_CASE      ,  atol=1e-3   )   )






							def snake_case_	( self      ,  a_      ,  a_      ,  ):
									a_  :   Any			    =  UMTaModel(config=__SCREAMING_SNAKE_CASE   ).to(__SCREAMING_SNAKE_CASE   ).half().eval()
									a_  :   Any			    =  model(**__SCREAMING_SNAKE_CASE   )["last_hidden_state"]
									self.parent.assertFalse(torch.isnan(__SCREAMING_SNAKE_CASE   ).any().item()   )




@require_torch
class       snake_case_    (    __snake_case  ,__snake_case  ,__snake_case  ,unittest.TestCase					):
							__lowerCAmelCase            =       (
							    (UMTaModel, UMTaForConditionalGeneration, UMTaForQuestionAnswering) if is_torch_available() else ()
							)
							__lowerCAmelCase            =       (UMTaForConditionalGeneration,) if is_torch_available() else ()
							__lowerCAmelCase            =       (
							    {
							        """conversational""": UMTaForConditionalGeneration,
							        """feature-extraction""": UMTaModel,
							        """summarization""": UMTaForConditionalGeneration,
							        """text2text-generation""": UMTaForConditionalGeneration,
							        """translation""": UMTaForConditionalGeneration,
							        """question-answering""": UMTaForQuestionAnswering,
							    }
							    if is_torch_available()
							    else {}
							)
							__lowerCAmelCase            =       True
							__lowerCAmelCase            =       False
							__lowerCAmelCase            =       False
							__lowerCAmelCase            =       True
							__lowerCAmelCase            =       True
							# The small UMT5 model needs higher percentages for CPU/MP tests
							__lowerCAmelCase            =       [0.8, 0.9]






							def snake_case_	( self   ):
									a_  :   Optional[Any]			    =  UMTaModelTester(self   )






							@unittest.skip("Test has a segmentation fault on torch 1.8.0"   )
							def snake_case_	( self   ):
									a_  :   Tuple			    =  self.model_tester.prepare_config_and_inputs()
									a_  :   Optional[int]			    =  UMTaModel(config_and_inputs[0]   ).to(__SCREAMING_SNAKE_CASE   )
									with tempfile.TemporaryDirectory() as tmpdirname:
											torch.onnx.export(
											    __SCREAMING_SNAKE_CASE      ,  (config_and_inputs[1], config_and_inputs[3], config_and_inputs[2])      ,  F"""{tmpdirname}/t5_test.onnx"""      ,  export_params=__SCREAMING_SNAKE_CASE      ,  opset_version=9      ,  input_names=["input_ids", "decoder_input_ids"]      ,  )






							@unittest.skipIf(torch_device == "cpu"      ,  "Cant do half precision"   )
							def snake_case_	( self   ):
									a_  :   str			    =  self.model_tester.prepare_config_and_inputs()
									self.model_tester.create_and_check_model_fpaa_forward(*__SCREAMING_SNAKE_CASE   )






							def snake_case_	( self   ):
									a_  :   Union[str, Any]			    =  ["encoder_attentions", "decoder_attentions", "cross_attentions"]
									a_  :   Tuple			    =  self.model_tester.prepare_config_and_inputs()
									a_  :   Optional[int]			    =  config_and_inputs[0]
									a_  :   str			    =  UMTaForConditionalGeneration(__SCREAMING_SNAKE_CASE   ).eval()
									model.to(__SCREAMING_SNAKE_CASE   )

									a_  :   Union[str, Any]			    =  {
									    "head_mask": torch.zeros(config.num_layers      ,  config.num_heads      ,  device=__SCREAMING_SNAKE_CASE   ),
									    "decoder_head_mask": torch.zeros(config.num_decoder_layers      ,  config.num_heads      ,  device=__SCREAMING_SNAKE_CASE   ),
									    "cross_attn_head_mask": torch.zeros(config.num_decoder_layers      ,  config.num_heads      ,  device=__SCREAMING_SNAKE_CASE   ),
									}

									for attn_name, (name, mask) in zip(__SCREAMING_SNAKE_CASE      ,  head_masking.items()   ):
											a_  :   Optional[Any]			    =  {name: mask}
											# Explicitly pass decoder_head_mask as it is required from T5 model when head_mask specified
											if name == "head_mask":
													a_  :   Tuple			    =  torch.ones(
													    config.num_decoder_layers      ,  config.num_heads      ,  device=__SCREAMING_SNAKE_CASE   )

											a_  :   Optional[int]			    =  model.generate(
											    config_and_inputs[1]["input_ids"]      ,  num_beams=1      ,  max_length=3      ,  output_attentions=__SCREAMING_SNAKE_CASE      ,  return_dict_in_generate=__SCREAMING_SNAKE_CASE      ,  **__SCREAMING_SNAKE_CASE      ,  )
											# We check the state of decoder_attentions and cross_attentions just from the last step
											a_  :   int			    =  out[attn_name] if attn_name == attention_names[0] else out[attn_name][-1]
											self.assertEqual(sum([w.sum().item() for w in attn_weights]   )      ,  0.0   )






							@unittest.skip("Does not work on the tiny model as we keep hitting edge cases."   )
							def snake_case_	( self   ):
									pass




@require_torch
@require_sentencepiece
@require_tokenizers
class       snake_case_    (    unittest.TestCase					):






							@slow
							@unittest.skip(
							    "Unless we stop stripping left and right by default for all special tokens, the expected ids obtained here will not match the original ones. Wait for https://github.com/huggingface/transformers/pull/23909 to be merged"   )
							def snake_case_	( self   ):
									a_  :   int			    =  UMTaForConditionalGeneration.from_pretrained("google/umt5-small"      ,  return_dict=__SCREAMING_SNAKE_CASE   ).to(__SCREAMING_SNAKE_CASE   )
									a_  :   Tuple			    =  AutoTokenizer.from_pretrained("google/umt5-small"      ,  use_fast=__SCREAMING_SNAKE_CASE      ,  legacy=__SCREAMING_SNAKE_CASE   )
									a_  :   Union[str, Any]			    =  [
									    "Bonjour monsieur <extra_id_0> bien <extra_id_1>.",
									    "No se como puedo <extra_id_0>.",
									    "This is the reason why we <extra_id_0> them.",
									    "The <extra_id_0> walks in <extra_id_1>, seats",
									    "A <extra_id_0> walks into a bar and orders a <extra_id_1> with <extra_id_2> pinch of <extra_id_3>.",
									]
									a_  :   Tuple			    =  tokenizer(__SCREAMING_SNAKE_CASE      ,  return_tensors="pt"      ,  padding=__SCREAMING_SNAKE_CASE   ).input_ids
									# fmt: off
									a_  :   int			    =  torch.tensor(
									    [
									        [ 3_8_5_3_0, 2_1_0_7_0_3, 2_5_6_2_9_9, 1_4_1_0, 2_5_6_2_9_8, 2_7_4, 1, 0,0, 0, 0, 0, 0, 0, 0, 0,0, 0],
									        [   8_2_6, 3_2_1, 6_7_1, 2_5_9_2_2, 2_5_6_2_9_9, 2_7_4, 1, 0,0, 0, 0, 0, 0, 0, 0, 0,0, 0],
									        [  1_4_6_0, 3_3_9, 3_1_2, 1_9_0_1_4, 1_0_6_2_0, 7_5_8, 2_5_6_2_9_9, 2_3_5_5,2_7_4, 1, 0, 0, 0, 0, 0, 0,0, 0],
									        [   5_1_7, 2_5_6_2_9_9, 1_4_8_6_9, 2_8_1, 3_0_1, 2_5_6_2_9_8, 2_7_5, 1_1_9_9_8_3,1, 0, 0, 0, 0, 0, 0, 0,0, 0],
									        [   3_2_0, 2_5_6_2_9_9, 1_4_8_6_9, 2_8_1, 2_2_3_4, 2_8_9, 2_2_7_5, 3_3_3,6_1_3_9_1, 2_8_9, 2_5_6_2_9_8, 5_4_3, 2_5_6_2_9_7, 1_6_8_7_1_4, 3_2_9, 2_5_6_2_9_6,2_7_4, 1],
									    ]   )
									# fmt: on
									torch.testing.assert_allclose(__SCREAMING_SNAKE_CASE      ,  __SCREAMING_SNAKE_CASE   )

									a_  :   List[str]			    =  model.generate(input_ids.to(__SCREAMING_SNAKE_CASE   )   )
									a_  :   Union[str, Any]			    =  [
									    "<pad><extra_id_0> et<extra_id_1> [eod] <extra_id_2><extra_id_55>.. [eod] 💐 💐 💐 💐 💐 💐 💐 💐 💐 💐 💐 <extra_id_56>ajšietosto<extra_id_56>lleux<extra_id_19><extra_id_6>ajšie</s>",
									    "<pad><extra_id_0>.<extra_id_1>.,<0x0A>...spech <0x0A><extra_id_20> <extra_id_21></s><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad>",
									    "<pad><extra_id_0> are not going to be a part of the world. We are not going to be a part of<extra_id_1> and<extra_id_2><0x0A><extra_id_48>.<extra_id_48></s><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad>",
									    "<pad><extra_id_0> door<extra_id_1>, the door<extra_id_2> 피해[/</s><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad>",
									    "<pad><extra_id_0>nyone who<extra_id_1> drink<extra_id_2> a<extra_id_3> alcohol<extra_id_4> A<extra_id_5> A. This<extra_id_6> I<extra_id_7><extra_id_52><extra_id_53></s><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad>",
									]
									a_  :   Optional[int]			    =  tokenizer.batch_decode(__SCREAMING_SNAKE_CASE   )
									self.assertEqual(__SCREAMING_SNAKE_CASE      ,  __SCREAMING_SNAKE_CASE   )







"""simple docstring"""





from scipy.stats import pearsonr

import datasets


_SCREAMING_SNAKE_CASE   :							List[str]          =		'''
Pearson correlation coefficient and p-value for testing non-correlation.
The Pearson correlation coefficient measures the linear relationship between two datasets. The calculation of the p-value relies on the assumption that each dataset is normally distributed. Like other correlation coefficients, this one varies between -1 and +1 with 0 implying no correlation. Correlations of -1 or +1 imply an exact linear relationship. Positive correlations imply that as x increases, so does y. Negative correlations imply that as x increases, y decreases.
The p-value roughly indicates the probability of an uncorrelated system producing datasets that have a Pearson correlation at least as extreme as the one computed from these datasets.
'''


_SCREAMING_SNAKE_CASE   :							int          =		'''
Args:
    predictions (`list` of `int`): Predicted class labels, as returned by a model.
    references (`list` of `int`): Ground truth labels.
    return_pvalue (`boolean`): If `True`, returns the p-value, along with the correlation coefficient. If `False`, returns only the correlation coefficient. Defaults to `False`.

Returns:
    pearsonr (`float`): Pearson correlation coefficient. Minimum possible value is -1. Maximum possible value is 1. Values of 1 and -1 indicate exact linear positive and negative relationships, respectively. A value of 0 implies no correlation.
    p-value (`float`): P-value, which roughly indicates the probability of an The p-value roughly indicates the probability of an uncorrelated system producing datasets that have a Pearson correlation at least as extreme as the one computed from these datasets. Minimum possible value is 0. Maximum possible value is 1. Higher values indicate higher probabilities.

Examples:

    Example 1-A simple example using only predictions and references.
        >>> pearsonr_metric = datasets.load_metric("pearsonr")
        >>> results = pearsonr_metric.compute(predictions=[10, 9, 2.5, 6, 4], references=[1, 2, 3, 4, 5])
        >>> print(round(results[\'pearsonr\'], 2))
        -0.74

    Example 2-The same as Example 1, but that also returns the `p-value`.
        >>> pearsonr_metric = datasets.load_metric("pearsonr")
        >>> results = pearsonr_metric.compute(predictions=[10, 9, 2.5, 6, 4], references=[1, 2, 3, 4, 5], return_pvalue=True)
        >>> print(sorted(list(results.keys())))
        [\'p-value\', \'pearsonr\']
        >>> print(round(results[\'pearsonr\'], 2))
        -0.74
        >>> print(round(results[\'p-value\'], 2))
        0.15
'''


_SCREAMING_SNAKE_CASE   :							Dict          =		'''
@article{2020SciPy-NMeth,
author  = {Virtanen, Pauli and Gommers, Ralf and Oliphant, Travis E. and
      Haberland, Matt and Reddy, Tyler and Cournapeau, David and
      Burovski, Evgeni and Peterson, Pearu and Weckesser, Warren and
      Bright, Jonathan and {van der Walt}, St{\'e}fan J. and
      Brett, Matthew and Wilson, Joshua and Millman, K. Jarrod and
      Mayorov, Nikolay and Nelson, Andrew R. J. and Jones, Eric and
      Kern, Robert and Larson, Eric and Carey, C J and
      Polat, Ilhan and Feng, Yu and Moore, Eric W. and
      {VanderPlas}, Jake and Laxalde, Denis and Perktold, Josef and
      Cimrman, Robert and Henriksen, Ian and Quintero, E. A. and
      Harris, Charles R. and Archibald, Anne M. and
      Ribeiro, Antonio H. and Pedregosa, Fabian and
      {van Mulbregt}, Paul and {SciPy 1.0 Contributors}},
title   = {{{SciPy} 1.0: Fundamental Algorithms for Scientific
      Computing in Python}},
journal = {Nature Methods},
year    = {2020},
volume  = {17},
pages   = {261--272},
adsurl  = {https://rdcu.be/b08Wh},
doi = {10.1038/s41592-019-0686-2},
}
'''






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






    def   UpperCamelCase			(			self	:				Dict   )	->						Any:
      return datasets.MetricInfo(
          description=_DESCRIPTION			,		citation=_CITATION			,		inputs_description=_KWARGS_DESCRIPTION			,		features=datasets.Features(
              {
                  'predictions': datasets.Value('float'   ),
                  'references': datasets.Value('float'   ),
              }   )			,		reference_urls=['https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.pearsonr.html']			,		)






    def   UpperCamelCase			(			self	:				Union[str, Any]			,		__SCREAMING_SNAKE_CASE	:				List[Any]			,		__SCREAMING_SNAKE_CASE	:				Tuple			,		__SCREAMING_SNAKE_CASE	:				Tuple=False   )	->						Tuple:
      if return_pvalue:
        lowerCamelCase_       	=		pearsonr(__SCREAMING_SNAKE_CASE			,		__SCREAMING_SNAKE_CASE   )
        return {"pearsonr": results[0], "p-value": results[1]}
      else:
        return {"pearsonr": float(pearsonr(__SCREAMING_SNAKE_CASE			,		__SCREAMING_SNAKE_CASE   )[0]   )}




