
"""simple docstring"""




import logging
import pathlib
import re
import sys
from dataclasses import dataclass, field
from typing import Any, Callable, Dict, List, Optional, Set, Union

import datasets
import librosa
import numpy as np
import torch
from lang_trans import arabic
from packaging import version
from torch import nn

from transformers import (
    HfArgumentParser,
    Trainer,
    TrainingArguments,
    WavaVecaCTCTokenizer,
    WavaVecaFeatureExtractor,
    WavaVecaForCTC,
    WavaVecaProcessor,
    is_apex_available,
    trainer_utils,
)


if is_apex_available():
    from apex import amp

if version.parse(version.parse(torch.__version__).base_version) >= version.parse('1.6'):
    a		:					List[Any]    	=					True
    from torch.cuda.amp import autocast


a		:					Optional[int]    	=					logging.getLogger(__name__)







@dataclass
class 						lowercase:
     __snake_case:  str  				=    field(
         metadata={'help': 'Path to pretrained model or model identifier from huggingface.co/models'}					)
     __snake_case:  Optional[str]  				=    field(
         default=_lowercase						,	metadata={'help': 'Where do you want to store the pretrained models downloaded from huggingface.co'}						,	)
     __snake_case:  Optional[bool]  				=    field(
         default=_lowercase						,	metadata={'help': 'Whether to freeze the feature extractor layers of the model.'}					)
     __snake_case:  Optional[bool]  				=    field(
         default=_lowercase						,	metadata={'help': 'Whether to log verbose messages or not.'}						,	)




def 						__magic_name__		(				UpperCamelCase    :		ModelArguments       ,		UpperCamelCase    :		TrainingArguments    )    ->	int:
    logging.basicConfig(
        format='%(asctime)s - %(levelname)s - %(name)s - %(message)s'       ,		datefmt='%m/%d/%Y %H:%M:%S'       ,		handlers=[logging.StreamHandler(sys.stdout    )]       ,		)
    a__    = logging.WARNING
    if model_args.verbose_logging:
        a__    = logging.DEBUG
    elif trainer_utils.is_main_process(training_args.local_rank    ):
        a__    = logging.INFO
    logger.setLevel(UpperCamelCase    )







@dataclass
class 						lowercase:
     __snake_case:  str  				=    field(
         default=_lowercase						,	metadata={'help': 'The name of the dataset to use (via the datasets library).'}					)
     __snake_case:  Optional[str]  				=    field(
         default=_lowercase						,	metadata={'help': 'The configuration name of the dataset to use (via the datasets library).'}					)
     __snake_case:  Optional[str]  				=    field(
         default='train'						,	metadata={
             'help': 'The name of the training data set split to use (via the datasets library). Defaults to \'train\''
         }						,	)
     __snake_case:  Optional[str]  				=    field(
         default='validation'						,	metadata={
             'help': (
                 'The name of the validation data set split to use (via the datasets library). Defaults to \'validation\''
             )
         }						,	)
     __snake_case:  Optional[str]  				=    field(
         default='text'						,	metadata={'help': 'Column in the dataset that contains label (target text). Defaults to \'text\''}						,	)
     __snake_case:  Optional[str]  				=    field(
         default='file'						,	metadata={'help': 'Column in the dataset that contains speech file path. Defaults to \'file\''}						,	)
     __snake_case:  Optional[bool]  				=    field(
         default=_lowercase						,	metadata={'help': 'Resample loaded audio to target feature extractor\'s sampling rate or not.'}						,	)
     __snake_case:  Optional[float]  				=    field(
         default=_lowercase						,	metadata={'help': 'Filters out examples longer than specified. Defaults to no filtering.'}						,	)
     __snake_case:  Optional[str]  				=    field(
         default='librispeech'						,	metadata={
             'help': (
                 'Orthography used for normalization and tokenization: \'librispeech\' (default), \'timit\', or'
                 ' \'buckwalter\'.'
             )
         }						,	)
     __snake_case:  bool  				=    field(
         default=_lowercase						,	metadata={'help': 'Overwrite the cached preprocessed datasets or not.'}					)
     __snake_case:  Optional[int]  				=    field(
         default=_lowercase						,	metadata={'help': 'The number of processes to use for the preprocessing.'}						,	)







@dataclass
class 						lowercase:
     __snake_case:  bool  				=    False
     __snake_case:  Optional[str]  				=    None
     __snake_case:  Optional[str]  				=    "|"
     __snake_case:  Optional[Dict[str, str]]  				=    field(default_factory=_lowercase					)
     __snake_case:  Optional[Set[str]]  				=    field(default_factory=_lowercase					)
     __snake_case:  Optional[Callable[[str], str]]  				=    None



     @classmethod
     def  lowercase__     (       cls    ,							__SCREAMING_SNAKE_CASE      )		->    Optional[int]:







         """simple docstring"""



         if name == "librispeech":
             return cls()
         if name == "timit":
             return cls(
                 do_lower_case=__SCREAMING_SNAKE_CASE    ,							translation_table=str.maketrans({'-': ' '}      )    ,							)
         if name == "buckwalter":
             a__    = {
                 '-': ' ',  # sometimes used to represent pauses
                 '^': 'v',  # fixing "tha" in arabic_speech_corpus dataset
             }
             return cls(
                 vocab_file=pathlib.Path(__SCREAMING_SNAKE_CASE      ).parent.joinpath('vocab/buckwalter.json'      )    ,							word_delimiter_token='/'    ,							translation_table=str.maketrans(__SCREAMING_SNAKE_CASE      )    ,							words_to_remove={'sil'}    ,							untransliterator=arabic.buckwalter.untransliterate    ,							)
         raise ValueError(f'Unsupported orthography: \'{name}\'.'      )



     def  lowercase__     (       self    ,							__SCREAMING_SNAKE_CASE      )		->    str:







         """simple docstring"""



         if len(self.translation_table      ) > 0:
             a__    = text.translate(self.translation_table      )
         if len(self.words_to_remove      ) == 0:
             a__    = ' '.join(text.split()      )  # clean up whitespaces
         else:
             a__    = ' '.join(w for w in text.split() if w not in self.words_to_remove      )  # and clean up whilespaces
         return text




     def  lowercase__     (       self    ,							__SCREAMING_SNAKE_CASE      )		->    WavaVecaProcessor:







         """simple docstring"""



         a__    = WavaVecaFeatureExtractor.from_pretrained(
             model_args.model_name_or_path    ,							cache_dir=model_args.cache_dir      )
         if self.vocab_file:
             a__    = WavaVecaCTCTokenizer(
                 self.vocab_file    ,							cache_dir=model_args.cache_dir    ,							do_lower_case=self.do_lower_case    ,							word_delimiter_token=self.word_delimiter_token    ,							)
         else:
             a__    = WavaVecaCTCTokenizer.from_pretrained(
                 model_args.model_name_or_path    ,							cache_dir=model_args.cache_dir    ,							do_lower_case=self.do_lower_case    ,							word_delimiter_token=self.word_delimiter_token    ,							)
         return WavaVecaProcessor(__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE      )







@dataclass
class 						lowercase:
     __snake_case:  WavaVecaProcessor
     __snake_case:  Union[bool, str]  				=    True
     __snake_case:  Optional[int]  				=    None
     __snake_case:  Optional[int]  				=    None
     __snake_case:  Optional[int]  				=    None
     __snake_case:  Optional[int]  				=    None



     def __call__(       self    ,							__SCREAMING_SNAKE_CASE      )		->    Dict[str, torch.Tensor]:







         """simple docstring"""



         a__    = [{'input_values': feature['input_values']} for feature in features]
         a__    = [{'input_ids': feature['labels']} for feature in features]

         a__    = self.processor.pad(
             __SCREAMING_SNAKE_CASE    ,							padding=self.padding    ,							max_length=self.max_length    ,							pad_to_multiple_of=self.pad_to_multiple_of    ,							return_tensors='pt'    ,							)
         a__    = self.processor.pad(
             labels=__SCREAMING_SNAKE_CASE    ,							padding=self.padding    ,							max_length=self.max_length_labels    ,							pad_to_multiple_of=self.pad_to_multiple_of_labels    ,							return_tensors='pt'    ,							)

         # replace padding with -100 to ignore loss correctly
         a__    = labels_batch['input_ids'].masked_fill(labels_batch.attention_mask.ne(1      )    ,							-1_0_0      )

         a__    = labels

         return batch







class 						lowercase(_lowercase					):



     def  lowercase__     (       self    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE      )		->    torch.Tensor:







         """simple docstring"""



         model.train()
         a__    = self._prepare_inputs(__SCREAMING_SNAKE_CASE      )

         if self.use_amp:
             with autocast():
                 a__    = self.compute_loss(__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE      )
         else:
             a__    = self.compute_loss(__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE      )

         if self.args.n_gpu > 1:
             if model.module.config.ctc_loss_reduction == "mean":
                 a__    = loss.mean()
             elif model.module.config.ctc_loss_reduction == "sum":
                 a__    = loss.sum() / (inputs['labels'] >= 0).sum()
             else:
                 raise ValueError(f'{model.config.ctc_loss_reduction} is not valid. Choose one of [\'mean\', \'sum\']'      )

         if self.args.gradient_accumulation_steps > 1:
             a__    = loss / self.args.gradient_accumulation_steps

         if self.use_amp:
             self.scaler.scale(__SCREAMING_SNAKE_CASE      ).backward()
         elif self.use_apex:
             with amp.scale_loss(__SCREAMING_SNAKE_CASE    ,							self.optimizer      ) as scaled_loss:
                 scaled_loss.backward()
         elif self.deepspeed:
             self.deepspeed.backward(__SCREAMING_SNAKE_CASE      )
         else:
             loss.backward()

         return loss.detach()




def 						__magic_name__		(				)    ->	List[str]:
    # See all possible arguments in src/transformers/training_args.py
    # or by passing the --help flag to this script.
    # We now keep distinct sets of args, for a cleaner separation of concerns.

    a__    = HfArgumentParser((ModelArguments, DataTrainingArguments, TrainingArguments)    )

    a__  ,    a__  ,    a__    = parser.parse_args_into_dataclasses()
    configure_logger(UpperCamelCase       ,		UpperCamelCase    )

    a__    = Orthography.from_name(data_args.orthography.lower()    )
    a__    = orthography.create_processor(UpperCamelCase    )
    a__    = WavaVecaForCTC.from_pretrained(
        model_args.model_name_or_path       ,		cache_dir=model_args.cache_dir       ,		gradient_checkpointing=training_args.gradient_checkpointing       ,		vocab_size=len(processor.tokenizer    )       ,		)

    a__    = datasets.load_dataset(
        data_args.dataset_name       ,		data_args.dataset_config_name       ,		split=data_args.train_split_name    )
    a__    = datasets.load_dataset(
        data_args.dataset_name       ,		data_args.dataset_config_name       ,		split=data_args.validation_split_name    )

    a__    = datasets.load_metric('wer'    )
    a__    = processor.feature_extractor.sampling_rate if data_args.target_feature_extractor_sampling_rate else None
    a__    = ''.join(t for t in processor.tokenizer.get_vocab().keys() if len(UpperCamelCase    ) == 1    )
    a__    = re.compile(  # remove characters not in vocabulary
        rf'[^\s{re.escape(UpperCamelCase    )}]'       ,		flags=re.IGNORECASE if processor.tokenizer.do_lower_case else 0       ,		)
    a__    = []

    def prepare_example(UpperCamelCase    :		Any    ):  # TODO(elgeish) make use of multiprocessing?
        a__  ,    a__    = librosa.load(example[data_args.speech_file_column]       ,		sr=UpperCamelCase    )
        if data_args.max_duration_in_seconds is not None:
            a__    = len(example['speech']    ) / example['sampling_rate']
        # Normalize and clean up text; order matters!
        a__    = orthography.preprocess_for_training(example[data_args.target_text_column]    )
        a__    = vocabulary_text_cleaner.sub(''       ,		UpperCamelCase    )
        if updated_text != example[data_args.target_text_column]:
            text_updates.append((example[data_args.target_text_column], updated_text)    )
            a__    = updated_text
        return example

    a__    = train_dataset.map(UpperCamelCase       ,		remove_columns=[data_args.speech_file_column]    )
    a__    = val_dataset.map(UpperCamelCase       ,		remove_columns=[data_args.speech_file_column]    )

    if data_args.max_duration_in_seconds is not None:

        def filter_by_max_duration(UpperCamelCase    :		str    ):
            return example["duration_in_seconds"] <= data_args.max_duration_in_seconds

        a__    = len(UpperCamelCase    )
        a__    = len(UpperCamelCase    )
        a__    = train_dataset.filter(UpperCamelCase       ,		remove_columns=['duration_in_seconds']    )
        a__    = val_dataset.filter(UpperCamelCase       ,		remove_columns=['duration_in_seconds']    )
        if len(UpperCamelCase    ) > old_train_size:
            logger.warning(
                f'Filtered out {len(UpperCamelCase    ) - old_train_size} train example(s) longer than'
                f' {data_args.max_duration_in_seconds} second(s).'    )
        if len(UpperCamelCase    ) > old_val_size:
            logger.warning(
                f'Filtered out {len(UpperCamelCase    ) - old_val_size} validation example(s) longer than'
                f' {data_args.max_duration_in_seconds} second(s).'    )
    logger.info(f'Split sizes: {len(UpperCamelCase    )} train and {len(UpperCamelCase    )} validation.'    )

    logger.warning(f'Updated {len(UpperCamelCase    )} transcript(s) using \'{data_args.orthography}\' orthography rules.'    )
    if logger.isEnabledFor(logging.DEBUG    ):
        for original_text, updated_text in text_updates:
            logger.debug(f'Updated text: "{original_text}" -> "{updated_text}"'    )
    a__    = None

    def prepare_dataset(UpperCamelCase    :		Union[str, Any]    ):
        # check that all files have the correct sampling rate
        assert (
            len(set(batch['sampling_rate']    )    ) == 1
        ), f'Make sure all inputs have the same sampling rate of {processor.feature_extractor.sampling_rate}.'

        a__    = processor(
            audio=batch['speech']       ,		text=batch[data_args.target_text_column]       ,		sampling_rate=batch['sampling_rate'][0]    )
        batch.update(UpperCamelCase    )
        return batch

    a__    = train_dataset.map(
        UpperCamelCase       ,		batch_size=training_args.per_device_train_batch_size       ,		batched=UpperCamelCase       ,		num_proc=data_args.preprocessing_num_workers       ,		)
    a__    = val_dataset.map(
        UpperCamelCase       ,		batch_size=training_args.per_device_train_batch_size       ,		batched=UpperCamelCase       ,		num_proc=data_args.preprocessing_num_workers       ,		)

    a__    = DataCollatorCTCWithPadding(processor=UpperCamelCase       ,		padding=UpperCamelCase    )

    def compute_metrics(UpperCamelCase    :		str    ):
        a__    = pred.predictions
        a__    = np.argmax(UpperCamelCase       ,		axis=-1    )

        a__    = processor.tokenizer.pad_token_id

        a__    = processor.batch_decode(UpperCamelCase    )
        # we do not want to group tokens when computing the metrics
        a__    = processor.batch_decode(pred.label_ids       ,		group_tokens=UpperCamelCase    )
        if logger.isEnabledFor(logging.DEBUG    ):
            for reference, predicted in zip(UpperCamelCase       ,		UpperCamelCase    ):
                logger.debug(f'reference: "{reference}"'    )
                logger.debug(f'predicted: "{predicted}"'    )
                if orthography.untransliterator is not None:
                    logger.debug(f'reference (untransliterated): "{orthography.untransliterator(UpperCamelCase    )}"'    )
                    logger.debug(f'predicted (untransliterated): "{orthography.untransliterator(UpperCamelCase    )}"'    )

        a__    = wer_metric.compute(predictions=UpperCamelCase       ,		references=UpperCamelCase    )

        return {"wer": wer}

    if model_args.freeze_feature_extractor:
        model.freeze_feature_extractor()

    a__    = CTCTrainer(
        model=UpperCamelCase       ,		data_collator=UpperCamelCase       ,		args=UpperCamelCase       ,		compute_metrics=UpperCamelCase       ,		train_dataset=UpperCamelCase       ,		eval_dataset=UpperCamelCase       ,		tokenizer=processor.feature_extractor       ,		)

    trainer.train()


if __name__ == "__main__":
    main()




"""simple docstring"""




from sklearn.metrics import roc_auc_score

import datasets


a		:					Tuple    	=					'\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		:					int    	=					'\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		:					List[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					):



     def  lowercase__     (       self      )		->    str:







         """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  lowercase__     (       self    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE    ,							__SCREAMING_SNAKE_CASE="macro"    ,							__SCREAMING_SNAKE_CASE=None    ,							__SCREAMING_SNAKE_CASE=None    ,							__SCREAMING_SNAKE_CASE="raise"    ,							__SCREAMING_SNAKE_CASE=None    ,							)		->    Any:







         """simple docstring"""



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


