


import copy
import inspect
import unittest

import numpy as np
from huggingface_hub import hf_hub_download

from transformers import VivitConfig
from transformers.models.auto import get_values
from transformers.testing_utils import require_torch, require_vision, slow, torch_device
from transformers.utils import cached_property, is_torch_available, is_vision_available

from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, floats_tensor, ids_tensor


if is_torch_available():
    import torch
    from torch import nn

    from transformers import MODEL_FOR_VIDEO_CLASSIFICATION_MAPPING, VivitForVideoClassification, VivitModel
    from transformers.models.vivit.modeling_vivit import VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST


if is_vision_available():
    from transformers import VivitImageProcessor







class       _lowercase			:


       """simple docstring"""




       def __init__(       self							:      Any ,				__lowerCamelCase							:      Optional[Any] ,				__lowerCamelCase							:      List[str]=2 ,				__lowerCamelCase							:      Union[str, Any]=True ,				__lowerCamelCase							:      Union[str, Any]=True ,				__lowerCamelCase							:      Optional[Any]=10 ,				__lowerCamelCase							:      List[str]=10 ,				__lowerCamelCase							:      int=8 ,				__lowerCamelCase							:      Tuple=[2, 4, 4] ,				__lowerCamelCase							:      Union[str, Any]=3 ,				__lowerCamelCase							:      Optional[int]=768 ,				__lowerCamelCase							:      List[Any]=5 ,				__lowerCamelCase							:      str=4 ,				__lowerCamelCase							:      List[Any]=37 ,				__lowerCamelCase							:      List[str]="gelu_fast" ,				__lowerCamelCase							:      Any=0.0 ,				__lowerCamelCase							:      Optional[Any]=0.0 ,				__lowerCamelCase							:      str=0.0_2 ,				__lowerCamelCase							:      Tuple=1E-0_6 ,				__lowerCamelCase							:      str=True ,				__lowerCamelCase							:      Dict=None ,				):


             '''simple docstring'''



             lowerCamelCase__		:    int   =  parent
             lowerCamelCase__		:    int   =  batch_size
             lowerCamelCase__		:    str   =  is_training
             lowerCamelCase__		:    Dict   =  use_labels
             lowerCamelCase__		:    List[Any]   =  num_labels
             lowerCamelCase__		:    int   =  image_size
             lowerCamelCase__		:    str   =  num_frames
             lowerCamelCase__		:    int   =  tubelet_size
             lowerCamelCase__		:    int   =  num_channels
             lowerCamelCase__		:    Dict   =  hidden_size
             lowerCamelCase__		:    Dict   =  num_hidden_layers
             lowerCamelCase__		:    Any   =  num_attention_heads
             lowerCamelCase__		:    List[str]   =  intermediate_size
             lowerCamelCase__		:    List[Any]   =  hidden_act
             lowerCamelCase__		:    int   =  hidden_dropout_prob
             lowerCamelCase__		:    Tuple   =  attention_probs_dropout_prob
             lowerCamelCase__		:    List[str]   =  initializer_range
             lowerCamelCase__		:    Tuple   =  layer_norm_eps
             lowerCamelCase__		:    List[Any]   =  qkv_bias
             lowerCamelCase__		:    str   =  scope

             lowerCamelCase__		:    int   =  (
                 (self.image_size // self.tubelet_size[2])
                 * (self.image_size // self.tubelet_size[1])
                 * (self.num_frames // self.tubelet_size[0])
             ) + 1  # CLS token





       def 						lowerCAmelCase					(       self							:      Tuple	):


             '''simple docstring'''



             lowerCamelCase__		:    Optional[int]   =  floats_tensor(
                 [self.batch_size, self.num_frames, self.num_channels, self.image_size, self.image_size]	)

             lowerCamelCase__		:    str   =  None
             if self.use_labels:
                   lowerCamelCase__		:    Optional[int]   =  ids_tensor([self.batch_size] ,				self.num_labels	)

             lowerCamelCase__		:    str   =  self.get_config()

             return config, pixel_values, labels





       def 						lowerCAmelCase					(       self							:      Tuple	):


             '''simple docstring'''



             lowerCamelCase__		:    Optional[int]   =  VivitConfig(
                 num_frames=self.num_frames ,				image_size=self.image_size ,				tubelet_size=self.tubelet_size ,				num_channels=self.num_channels ,				hidden_size=self.hidden_size ,				num_hidden_layers=self.num_hidden_layers ,				num_attention_heads=self.num_attention_heads ,				intermediate_size=self.intermediate_size ,				hidden_act=self.hidden_act ,				hidden_dropout_prob=self.hidden_dropout_prob ,				attention_probs_dropout_prob=self.attention_probs_dropout_prob ,				initializer_range=self.initializer_range ,				layer_norm_eps=self.layer_norm_eps ,				qkv_bias=self.qkv_bias ,				)
             lowerCamelCase__		:    Dict   =  self.num_labels
             return config





       def 						lowerCAmelCase					(       self							:      List[str] ,				__lowerCamelCase							:      int ,				__lowerCamelCase							:      List[Any] ,				__lowerCamelCase							:      Optional[Any]	):


             '''simple docstring'''



             lowerCamelCase__		:    Union[str, Any]   =  VivitModel(config=__lowerCamelCase	)
             model.to(__lowerCamelCase	)
             model.eval()
             lowerCamelCase__		:    Union[str, Any]   =  model(__lowerCamelCase	)
             self.parent.assertEqual(result.last_hidden_state.shape ,				(self.batch_size, self.seq_length, self.hidden_size)	)





       def 						lowerCAmelCase					(       self							:      List[Any] ,				__lowerCamelCase							:      int ,				__lowerCamelCase							:      Any ,				__lowerCamelCase							:      Tuple	):


             '''simple docstring'''



             lowerCamelCase__		:    Dict   =  VivitForVideoClassification(__lowerCamelCase	)
             model.to(__lowerCamelCase	)
             model.eval()

             lowerCamelCase__		:    Tuple   =  model(__lowerCamelCase	)

             # verify the logits shape
             lowerCamelCase__		:    str   =  torch.Size((self.batch_size, self.num_labels)	)
             self.parent.assertEqual(result.logits.shape ,				__lowerCamelCase	)





       def 						lowerCAmelCase					(       self							:      Dict	):


             '''simple docstring'''



             lowerCamelCase__		:    List[Any]   =  self.prepare_config_and_inputs()
             lowerCamelCase__   ,       lowerCamelCase__   ,       lowerCamelCase__		:    Any   =  config_and_inputs
             lowerCamelCase__		:    List[str]   =  {"pixel_values": pixel_values}
             return config, inputs_dict







@require_torch
class       _lowercase			(							lowercase__							,  unittest.TestCase):


       """simple docstring"""




       A__ 						=      (VivitModel, VivitForVideoClassification) if is_torch_available() else ()

       A__ 						=      False
       A__ 						=      False
       A__ 						=      False
       A__ 						=      False





       def 						lowerCAmelCase					(       self							:      str	):


             '''simple docstring'''



             lowerCamelCase__		:    List[str]   =  VivitModelTester(self	)
             lowerCamelCase__		:    Tuple   =  ConfigTester(self ,				config_class=__lowerCamelCase ,				has_text_modality=__lowerCamelCase ,				hidden_size=37	)





       def 						lowerCAmelCase					(       self							:      Dict ,				__lowerCamelCase							:      List[Any] ,				__lowerCamelCase							:      Dict ,				__lowerCamelCase							:      List[str]=False	):


             '''simple docstring'''



             lowerCamelCase__		:    Tuple   =  copy.deepcopy(__lowerCamelCase	)

             if return_labels:
                   if model_class in get_values(__lowerCamelCase	):
                         lowerCamelCase__		:    int   =  torch.zeros(
                             self.model_tester.batch_size ,				dtype=torch.long ,				device=__lowerCamelCase	)

             return inputs_dict





       def 						lowerCAmelCase					(       self							:      Optional[int]	):


             '''simple docstring'''



             self.config_tester.run_common_tests()





       @unittest.skip(reason="Vivit does not use inputs_embeds"	)
       def 						lowerCAmelCase					(       self							:      str	):


             '''simple docstring'''



             pass





       def 						lowerCAmelCase					(       self							:      Tuple	):


             '''simple docstring'''



             lowerCamelCase__   ,       lowerCamelCase__		:    Optional[int]   =  self.model_tester.prepare_config_and_inputs_for_common()

             for model_class in self.all_model_classes:
                   lowerCamelCase__		:    Union[str, Any]   =  model_class(__lowerCamelCase	)
                   self.assertIsInstance(model.get_input_embeddings() ,				(nn.Module)	)
                   lowerCamelCase__		:    str   =  model.get_output_embeddings()
                   self.assertTrue(x is None or isinstance(__lowerCamelCase ,				nn.Linear	)	)





       def 						lowerCAmelCase					(       self							:      str	):


             '''simple docstring'''



             lowerCamelCase__   ,       lowerCamelCase__		:    Optional[Any]   =  self.model_tester.prepare_config_and_inputs_for_common()

             for model_class in self.all_model_classes:
                   lowerCamelCase__		:    Tuple   =  model_class(__lowerCamelCase	)
                   lowerCamelCase__		:    Dict   =  inspect.signature(model.forward	)
                   # signature.parameters is an OrderedDict => so arg_names order is deterministic
                   lowerCamelCase__		:    Dict   =  [*signature.parameters.keys()]

                   lowerCamelCase__		:    List[Any]   =  ["pixel_values", "head_mask"]
                   self.assertListEqual(arg_names[:2] ,				__lowerCamelCase	)





       def 						lowerCAmelCase					(       self							:      Optional[Any]	):


             '''simple docstring'''



             lowerCamelCase__		:    Dict   =  self.model_tester.prepare_config_and_inputs()
             self.model_tester.create_and_check_model(*__lowerCamelCase	)





       def 						lowerCAmelCase					(       self							:      Optional[int]	):


             '''simple docstring'''



             lowerCamelCase__		:    Any   =  self.model_tester.prepare_config_and_inputs()
             self.model_tester.create_and_check_for_video_classification(*__lowerCamelCase	)





       @slow
       def 						lowerCAmelCase					(       self							:      Dict	):


             '''simple docstring'''



             for model_name in VIVIT_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
                   lowerCamelCase__		:    str   =  VivitModel.from_pretrained(__lowerCamelCase	)
                   self.assertIsNotNone(__lowerCamelCase	)





       def 						lowerCAmelCase					(       self							:      Optional[int]	):


             '''simple docstring'''



             lowerCamelCase__   ,       lowerCamelCase__		:    Union[str, Any]   =  self.model_tester.prepare_config_and_inputs_for_common()
             lowerCamelCase__		:    Any   =  True

             for model_class in self.all_model_classes:
                   lowerCamelCase__		:    Optional[int]   =  self.model_tester.seq_length

                   lowerCamelCase__		:    Optional[int]   =  True
                   lowerCamelCase__		:    Tuple   =  False
                   lowerCamelCase__		:    Optional[int]   =  True
                   lowerCamelCase__		:    List[Any]   =  model_class(__lowerCamelCase	)
                   model.to(__lowerCamelCase	)
                   model.eval()
                   with torch.no_grad():
                         lowerCamelCase__		:    Optional[int]   =  model(**self._prepare_for_class(__lowerCamelCase ,				__lowerCamelCase	)	)
                   lowerCamelCase__		:    Tuple   =  outputs.attentions
                   self.assertEqual(len(__lowerCamelCase	) ,				self.model_tester.num_hidden_layers	)

                   # check that output_attentions also work using config
                   del inputs_dict["output_attentions"]
                   lowerCamelCase__		:    str   =  True
                   lowerCamelCase__		:    Tuple   =  model_class(__lowerCamelCase	)
                   model.to(__lowerCamelCase	)
                   model.eval()
                   with torch.no_grad():
                         lowerCamelCase__		:    Optional[Any]   =  model(**self._prepare_for_class(__lowerCamelCase ,				__lowerCamelCase	)	)
                   lowerCamelCase__		:    Union[str, Any]   =  outputs.attentions
                   self.assertEqual(len(__lowerCamelCase	) ,				self.model_tester.num_hidden_layers	)

                   self.assertListEqual(
                       list(attentions[0].shape[-3:]	) ,				[self.model_tester.num_attention_heads, seq_len, seq_len] ,				)
                   lowerCamelCase__		:    List[str]   =  len(__lowerCamelCase	)

                   # Check attention is always last and order is fine
                   lowerCamelCase__		:    int   =  True
                   lowerCamelCase__		:    List[Any]   =  True
                   lowerCamelCase__		:    List[str]   =  model_class(__lowerCamelCase	)
                   model.to(__lowerCamelCase	)
                   model.eval()
                   with torch.no_grad():
                         lowerCamelCase__		:    Optional[int]   =  model(**self._prepare_for_class(__lowerCamelCase ,				__lowerCamelCase	)	)

                   self.assertEqual(out_len + 1 ,				len(__lowerCamelCase	)	)

                   lowerCamelCase__		:    Tuple   =  outputs.attentions

                   self.assertEqual(len(__lowerCamelCase	) ,				self.model_tester.num_hidden_layers	)

                   self.assertListEqual(
                       list(self_attentions[0].shape[-3:]	) ,				[self.model_tester.num_attention_heads, seq_len, seq_len] ,				)





       def 						lowerCAmelCase					(       self							:      Tuple	):


             '''simple docstring'''



             def check_hidden_states_output(__lowerCamelCase							:      List[Any] ,				__lowerCamelCase							:      Dict ,				__lowerCamelCase							:      Any	):
                   lowerCamelCase__		:    List[str]   =  model_class(__lowerCamelCase	)
                   model.to(__lowerCamelCase	)
                   model.eval()

                   with torch.no_grad():
                         lowerCamelCase__		:    Optional[int]   =  model(**self._prepare_for_class(__lowerCamelCase ,				__lowerCamelCase	)	)

                   lowerCamelCase__		:    Tuple   =  outputs.hidden_states
                   lowerCamelCase__		:    str   =  self.model_tester.num_hidden_layers + 1
                   self.assertEqual(len(__lowerCamelCase	) ,				__lowerCamelCase	)

                   lowerCamelCase__		:    int   =  self.model_tester.seq_length

                   self.assertListEqual(
                       list(hidden_states[0].shape[-2:]	) ,				[seq_length, self.model_tester.hidden_size] ,				)

             lowerCamelCase__   ,       lowerCamelCase__		:    str   =  self.model_tester.prepare_config_and_inputs_for_common()

             for model_class in self.all_model_classes:
                   lowerCamelCase__		:    Union[str, Any]   =  True
                   check_hidden_states_output(__lowerCamelCase ,				__lowerCamelCase ,				__lowerCamelCase	)

                   # check that output_hidden_states also work using config
                   del inputs_dict["output_hidden_states"]
                   lowerCamelCase__		:    Optional[Any]   =  True

                   check_hidden_states_output(__lowerCamelCase ,				__lowerCamelCase ,				__lowerCamelCase	)





       @unittest.skip("Will be fixed soon by reducing the size of the model used for common tests."	)
       def 						lowerCAmelCase					(       self							:      int	):


             '''simple docstring'''



             pass



def 				lowercase_		(		):

      """simple docstring"""




      lowerCamelCase__		:    Union[str, Any]   =  hf_hub_download(
          repo_id="hf-internal-testing/spaghetti-video"   , filename="eating_spaghetti_32_frames.npy"   , repo_type="dataset"						)
      lowerCamelCase__		:    Union[str, Any]   =  np.load(_A						)
      return list(_A						)







@require_torch
@require_vision
class       _lowercase			(							unittest.TestCase):


       """simple docstring"""




       @cached_property
       def 						lowerCAmelCase					(       self							:      Tuple	):


             '''simple docstring'''



             return VivitImageProcessor() if is_vision_available() else None





       @slow
       def 						lowerCAmelCase					(       self							:      Dict	):


             '''simple docstring'''



             lowerCamelCase__		:    Dict   =  VivitForVideoClassification.from_pretrained("google/vivit-b-16x2-kinetics400"	).to(__lowerCamelCase	)

             lowerCamelCase__		:    Optional[Any]   =  self.default_image_processor
             lowerCamelCase__		:    Union[str, Any]   =  prepare_video()
             lowerCamelCase__		:    Union[str, Any]   =  image_processor(__lowerCamelCase ,				return_tensors="pt"	).to(__lowerCamelCase	)

             # forward pass
             with torch.no_grad():
                   lowerCamelCase__		:    List[Any]   =  model(**__lowerCamelCase	)

             # verify the logits
             lowerCamelCase__		:    Optional[int]   =  torch.Size((1, 400)	)
             self.assertEqual(outputs.logits.shape ,				__lowerCamelCase	)

             # taken from original model
             lowerCamelCase__		:    Tuple   =  torch.tensor([-1.0_5_4_3, 2.0_7_6_4, -0.2_1_0_4, 0.4_4_3_9, -0.9_6_5_8]	).to(__lowerCamelCase	)

             self.assertTrue(torch.allclose(outputs.logits[0, :5] ,				__lowerCamelCase ,				atol=1E-4	)	)






from sklearn.metrics import roc_auc_score

import datasets


A				:   Optional[Any]		= "\nThis metric computes the area under the curve (AUC) for the Receiver Operating Characteristic Curve (ROC). The return values represent how well the model used is predicting the correct classes, based on the input data. A score of `0.5` means that the model is predicting exactly at chance, i.e. the model's predictions are correct at the same rate as if the predictions were being decided by the flip of a fair coin or the roll of a fair die. A score above `0.5` indicates that the model is doing better than chance, while a score below `0.5` indicates that the model is doing worse than chance.\n\nThis metric has three separate use cases:\n    - binary: The case in which there are only two different label classes, and each example gets only one label. This is the default implementation.\n    - multiclass: The case in which there can be more than two different label classes, but each example still gets only one label.\n    - multilabel: The case in which there can be more than two different label classes, and each example can have more than one label.\n"

A				:   str		= "\nArgs:\n- references (array-like of shape (n_samples,) or (n_samples, n_classes)): Ground truth labels. Expects different input based on use case:\n    - binary: expects an array-like of shape (n_samples,)\n    - multiclass: expects an array-like of shape (n_samples,)\n    - multilabel: expects an array-like of shape (n_samples, n_classes)\n- prediction_scores (array-like of shape (n_samples,) or (n_samples, n_classes)): Model predictions. Expects different inputs based on use case:\n    - binary: expects an array-like of shape (n_samples,)\n    - multiclass: expects an array-like of shape (n_samples, n_classes)\n    - multilabel: expects an array-like of shape (n_samples, n_classes)\n- average (`str`): Type of average, and is ignored in the binary use case. Defaults to 'macro'. Options are:\n    - `'micro'`: Calculates metrics globally by considering each element of the label indicator matrix as a label. Only works with the multilabel use case.\n    - `'macro'`: Calculate metrics for each label, and find their unweighted mean.  This does not take label imbalance into account.\n    - `'weighted'`: Calculate metrics for each label, and find their average, weighted by support (i.e. the number of true instances for each label).\n    - `'samples'`: Calculate metrics for each instance, and find their average. Only works with the multilabel use case.\n    - `None`:  No average is calculated, and scores for each class are returned. Only works with the multilabels use case.\n- sample_weight (array-like of shape (n_samples,)): Sample weights. Defaults to None.\n- max_fpr (`float`): If not None, the standardized partial AUC over the range [0, `max_fpr`] is returned. Must be greater than `0` and less than or equal to `1`. Defaults to `None`. Note: For the multiclass use case, `max_fpr` should be either `None` or `1.0` as ROC AUC partial computation is not currently supported for `multiclass`.\n- multi_class (`str`): Only used for multiclass targets, where it is required. Determines the type of configuration to use. Options are:\n    - `'ovr'`: Stands for One-vs-rest. Computes the AUC of each class against the rest. This treats the multiclass case in the same way as the multilabel case. Sensitive to class imbalance even when `average == 'macro'`, because class imbalance affects the composition of each of the 'rest' groupings.\n    - `'ovo'`: Stands for One-vs-one. Computes the average AUC of all possible pairwise combinations of classes. Insensitive to class imbalance when `average == 'macro'`.\n- labels (array-like of shape (n_classes,)): Only used for multiclass targets. List of labels that index the classes in\n    `prediction_scores`. If `None`, the numerical or lexicographical order of the labels in\n    `prediction_scores` is used. Defaults to `None`.\nReturns:\n    roc_auc (`float` or array-like of shape (n_classes,)): Returns array if in multilabel use case and `average='None'`. Otherwise, returns `float`.\nExamples:\n    Example 1:\n        >>> roc_auc_score = datasets.load_metric(\"roc_auc\")\n        >>> refs = [1, 0, 1, 1, 0, 0]\n        >>> pred_scores = [0.5, 0.2, 0.99, 0.3, 0.1, 0.7]\n        >>> results = roc_auc_score.compute(references=refs, prediction_scores=pred_scores)\n        >>> print(round(results['roc_auc'], 2))\n        0.78\n\n    Example 2:\n        >>> roc_auc_score = datasets.load_metric(\"roc_auc\", \"multiclass\")\n        >>> refs = [1, 0, 1, 2, 2, 0]\n        >>> pred_scores = [[0.3, 0.5, 0.2],\n        ...                 [0.7, 0.2, 0.1],\n        ...                 [0.005, 0.99, 0.005],\n        ...                 [0.2, 0.3, 0.5],\n        ...                 [0.1, 0.1, 0.8],\n        ...                 [0.1, 0.7, 0.2]]\n        >>> results = roc_auc_score.compute(references=refs, prediction_scores=pred_scores, multi_class='ovr')\n        >>> print(round(results['roc_auc'], 2))\n        0.85\n\n    Example 3:\n        >>> roc_auc_score = datasets.load_metric(\"roc_auc\", \"multilabel\")\n        >>> refs = [[1, 1, 0],\n        ...         [1, 1, 0],\n        ...         [0, 1, 0],\n        ...         [0, 0, 1],\n        ...         [0, 1, 1],\n        ...         [1, 0, 1]]\n        >>> pred_scores = [[0.3, 0.5, 0.2],\n        ...                 [0.7, 0.2, 0.1],\n        ...                 [0.005, 0.99, 0.005],\n        ...                 [0.2, 0.3, 0.5],\n        ...                 [0.1, 0.1, 0.8],\n        ...                 [0.1, 0.7, 0.2]]\n        >>> results = roc_auc_score.compute(references=refs, prediction_scores=pred_scores, average=None)\n        >>> print([round(res, 2) for res in results['roc_auc']])\n        [0.83, 0.38, 0.94]\n"

A				:   Optional[Any]		= "\\n@article{doi:10.1177/0272989X8900900307,\nauthor = {Donna Katzman McClish},\ntitle ={Analyzing a Portion of the ROC Curve},\njournal = {Medical Decision Making},\nvolume = {9},\nnumber = {3},\npages = {190-195},\nyear = {1989},\ndoi = {10.1177/0272989X8900900307},\n    note ={PMID: 2668680},\nURL = {https://doi.org/10.1177/0272989X8900900307},\neprint = {https://doi.org/10.1177/0272989X8900900307}\n}\n\n\n@article{10.1023/A:1010920819831,\nauthor = {Hand, David J. and Till, Robert J.},\ntitle = {A Simple Generalisation of the Area Under the ROC Curve for Multiple Class Classification Problems},\nyear = {2001},\nissue_date = {November 2001},\npublisher = {Kluwer Academic Publishers},\naddress = {USA},\nvolume = {45},\nnumber = {2},\nissn = {0885-6125},\nurl = {https://doi.org/10.1023/A:1010920819831},\ndoi = {10.1023/A:1010920819831},\njournal = {Mach. Learn.},\nmonth = {oct},\npages = {171–186},\nnumpages = {16},\nkeywords = {Gini index, AUC, error rate, ROC curve, receiver operating characteristic}\n}\n\n\n@article{scikit-learn,\ntitle={Scikit-learn: Machine Learning in {P}ython},\nauthor={Pedregosa, F. and Varoquaux, G. and Gramfort, A. and Michel, V. and Thirion, B. and Grisel, O. and Blondel, M. and Prettenhofer, P. and Weiss, R. and Dubourg, V. and Vanderplas, J. and Passos, A. and Cournapeau, D. and Brucher, M. and Perrot, M. and Duchesnay, E.},\njournal={Journal of Machine Learning Research},\nvolume={12},\npages={2825--2830},\nyear={2011}\n}\n"







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


       """simple docstring"""




       def 						lowerCAmelCase					(       self							:      List[Any]	):


             '''simple docstring'''



             return datasets.MetricInfo(
                 description=_DESCRIPTION ,				citation=_CITATION ,				inputs_description=_KWARGS_DESCRIPTION ,				features=datasets.Features(
                     {
                         "prediction_scores": datasets.Sequence(datasets.Value("float"	)	),
                         "references": datasets.Value("int32"	),
                     }
                     if self.config_name == "multiclass"
                     else {
                         "references": datasets.Sequence(datasets.Value("int32"	)	),
                         "prediction_scores": datasets.Sequence(datasets.Value("float"	)	),
                     }
                     if self.config_name == "multilabel"
                     else {
                         "references": datasets.Value("int32"	),
                         "prediction_scores": datasets.Value("float"	),
                     }	) ,				reference_urls=["https://scikit-learn.org/stable/modules/generated/sklearn.metrics.roc_auc_score.html"] ,				)





       def 						lowerCAmelCase					(       self							:      List[str] ,				__lowerCamelCase							:      Tuple ,				__lowerCamelCase							:      int ,				__lowerCamelCase							:      Optional[int]="macro" ,				__lowerCamelCase							:      Tuple=None ,				__lowerCamelCase							:      Any=None ,				__lowerCamelCase							:      Tuple="raise" ,				__lowerCamelCase							:      Tuple=None ,				):


             '''simple docstring'''



             return {
                 "roc_auc": roc_auc_score(
                     __lowerCamelCase ,				__lowerCamelCase ,				average=__lowerCamelCase ,				sample_weight=__lowerCamelCase ,				max_fpr=__lowerCamelCase ,				multi_class=__lowerCamelCase ,				labels=__lowerCamelCase ,				)
             }


