





from collections import Counter

import sacrebleu
import sacremoses
from packaging import version

import datasets


_UpperCAmelCase			   =							'\\n@inproceedings{xu-etal-2016-optimizing,\ntitle = {Optimizing Statistical Machine Translation for Text Simplification},\nauthors={Xu, Wei and Napoles, Courtney and Pavlick, Ellie and Chen, Quanze and Callison-Burch, Chris},\njournal = {Transactions of the Association for Computational Linguistics},\nvolume = {4},\nyear={2016},\nurl = {https://www.aclweb.org/anthology/Q16-1029},\npages = {401--415},\n}\n'

_UpperCAmelCase			   =							'\\nSARI is a metric used for evaluating automatic text simplification systems.\nThe metric compares the predicted simplified sentences against the reference\nand the source sentences. It explicitly measures the goodness of words that are\nadded, deleted and kept by the system.\nSari = (F1_add + F1_keep + P_del) / 3\nwhere\nF1_add: n-gram F1 score for add operation\nF1_keep: n-gram F1 score for keep operation\nP_del: n-gram precision score for delete operation\nn = 4, as in the original paper.\n\nThis implementation is adapted from Tensorflow\'s tensor2tensor implementation [3].\nIt has two differences with the original GitHub [1] implementation:\n  (1) Defines 0/0=1 instead of 0 to give higher scores for predictions that match\n      a target exactly.\n  (2) Fixes an alleged bug [2] in the keep score computation.\n[1] https://github.com/cocoxu/simplification/blob/master/SARI.py\n    (commit 0210f15)\n[2] https://github.com/cocoxu/simplification/issues/6\n[3] https://github.com/tensorflow/tensor2tensor/blob/master/tensor2tensor/utils/sari_hook.py\n'


_UpperCAmelCase			   =							'\nCalculates sari score (between 0 and 100) given a list of source and predicted\nsentences, and a list of lists of reference sentences.\nArgs:\n    sources: list of source sentences where each sentence should be a string.\n    predictions: list of predicted sentences where each sentence should be a string.\n    references: list of lists of reference sentences where each sentence should be a string.\nReturns:\n    sari: sari score\nExamples:\n    >>> sources=["About 95 species are currently accepted ."]\n    >>> predictions=["About 95 you now get in ."]\n    >>> references=[["About 95 species are currently known .","About 95 species are now accepted .","95 species are now accepted ."]]\n    >>> sari = datasets.load_metric("sari")\n    >>> results = sari.compute(sources=sources, predictions=predictions, references=references)\n    >>> print(results)\n    {\'sari\': 26.953601953601954}\n'






def        _SCREAMING_SNAKE_CASE		(			SCREAMING_SNAKE_CASE		:List[str]    ,    SCREAMING_SNAKE_CASE		:int    ,    SCREAMING_SNAKE_CASE		:Tuple    ,    SCREAMING_SNAKE_CASE		:str    )			->    int:
 __lowerCAmelCase     :       Optional[Any]						=   [rgram for rgrams in rgramslist for rgram in rgrams]
 __lowerCAmelCase     :       Dict						=   Counter(lowercase_    )

 __lowerCAmelCase     :       List[Any]						=   Counter(lowercase_    )
 __lowerCAmelCase     :       Dict						=   Counter()
 for sgram, scount in sgramcounter.items():
  __lowerCAmelCase     :       Union[str, Any]						=   scount * numref

 __lowerCAmelCase     :       Union[str, Any]						=   Counter(lowercase_    )
 __lowerCAmelCase     :       Union[str, Any]						=   Counter()
 for cgram, ccount in cgramcounter.items():
  __lowerCAmelCase     :       int						=   ccount * numref

 # KEEP
 __lowerCAmelCase     :       Tuple						=   sgramcounter_rep & cgramcounter_rep
 __lowerCAmelCase     :       Union[str, Any]						=   keepgramcounter_rep & rgramcounter
 __lowerCAmelCase     :       int						=   sgramcounter_rep & rgramcounter

 __lowerCAmelCase     :       Optional[Any]						=   0
 __lowerCAmelCase     :       str						=   0
 for keepgram in keepgramcountergood_rep:
  keeptmpscorea += keepgramcountergood_rep[keepgram] / keepgramcounter_rep[keepgram]
  # Fix an alleged bug [2] in the keep score computation.
  # keeptmpscore2 += keepgramcountergood_rep[keepgram] / keepgramcounterall_rep[keepgram]
  keeptmpscorea += keepgramcountergood_rep[keepgram]
 # Define 0/0=1 instead of 0 to give higher scores for predictions that match
 #      a target exactly.
 __lowerCAmelCase     :       Optional[Any]						=   1
 __lowerCAmelCase     :       Dict						=   1
 if len(lowercase_    ) > 0:
  __lowerCAmelCase     :       Any						=   keeptmpscorea / len(lowercase_    )
 if len(lowercase_    ) > 0:
  # Fix an alleged bug [2] in the keep score computation.
  # keepscore_recall = keeptmpscore2 / len(keepgramcounterall_rep)
  __lowerCAmelCase     :       Union[str, Any]						=   keeptmpscorea / sum(keepgramcounterall_rep.values()    )
 __lowerCAmelCase     :       Optional[Any]						=   0
 if keepscore_precision > 0 or keepscore_recall > 0:
  __lowerCAmelCase     :       int						=   2 * keepscore_precision * keepscore_recall / (keepscore_precision + keepscore_recall)

 # DELETION
 __lowerCAmelCase     :       Optional[int]						=   sgramcounter_rep - cgramcounter_rep
 __lowerCAmelCase     :       Optional[int]						=   delgramcounter_rep - rgramcounter
 __lowerCAmelCase     :       Union[str, Any]						=   sgramcounter_rep - rgramcounter
 __lowerCAmelCase     :       List[str]						=   0
 __lowerCAmelCase     :       Any						=   0
 for delgram in delgramcountergood_rep:
  deltmpscorea += delgramcountergood_rep[delgram] / delgramcounter_rep[delgram]
  deltmpscorea += delgramcountergood_rep[delgram] / delgramcounterall_rep[delgram]
 # Define 0/0=1 instead of 0 to give higher scores for predictions that match
 # a target exactly.
 __lowerCAmelCase     :       Dict						=   1
 if len(lowercase_    ) > 0:
  __lowerCAmelCase     :       Dict						=   deltmpscorea / len(lowercase_    )

 # ADDITION
 __lowerCAmelCase     :       Optional[int]						=   set(lowercase_    ) - set(lowercase_    )
 __lowerCAmelCase     :       Optional[Any]						=   set(lowercase_    ) & set(lowercase_    )
 __lowerCAmelCase     :       str						=   set(lowercase_    ) - set(lowercase_    )

 __lowerCAmelCase     :       Optional[Any]						=   0
 for addgram in addgramcountergood:
  addtmpscore += 1

 # Define 0/0=1 instead of 0 to give higher scores for predictions that match
 # a target exactly.
 __lowerCAmelCase     :       str						=   1
 __lowerCAmelCase     :       int						=   1
 if len(lowercase_    ) > 0:
  __lowerCAmelCase     :       Any						=   addtmpscore / len(lowercase_    )
 if len(lowercase_    ) > 0:
  __lowerCAmelCase     :       List[str]						=   addtmpscore / len(lowercase_    )
 __lowerCAmelCase     :       str						=   0
 if addscore_precision > 0 or addscore_recall > 0:
  __lowerCAmelCase     :       List[str]						=   2 * addscore_precision * addscore_recall / (addscore_precision + addscore_recall)

 return (keepscore, delscore_precision, addscore)






def        _SCREAMING_SNAKE_CASE		(			SCREAMING_SNAKE_CASE		:Any    ,    SCREAMING_SNAKE_CASE		:List[str]    ,    SCREAMING_SNAKE_CASE		:int    )			->    List[str]:
 __lowerCAmelCase     :       Union[str, Any]						=   len(lowercase_    )

 __lowerCAmelCase     :       Any						=   ssent.split(""" """    )
 __lowerCAmelCase     :       List[Any]						=   csent.split(""" """    )
 __lowerCAmelCase     :       Dict						=   []
 __lowerCAmelCase     :       Dict						=   []
 __lowerCAmelCase     :       int						=   []
 __lowerCAmelCase     :       Optional[Any]						=   []
 __lowerCAmelCase     :       Tuple						=   []
 __lowerCAmelCase     :       Union[str, Any]						=   []

 __lowerCAmelCase     :       Dict						=   []
 __lowerCAmelCase     :       Dict						=   []
 __lowerCAmelCase     :       int						=   []
 __lowerCAmelCase     :       Dict						=   []
 for rsent in rsents:
  __lowerCAmelCase     :       Tuple						=   rsent.split(""" """    )
  __lowerCAmelCase     :       str						=   []
  __lowerCAmelCase     :       str						=   []
  __lowerCAmelCase     :       Optional[Any]						=   []
  ragramslist.append(lowercase_    )
  for i in range(0    ,    len(lowercase_    ) - 1    ):
   if i < len(lowercase_    ) - 1:
    __lowerCAmelCase     :       Union[str, Any]						=   ragrams[i] + ' ' + ragrams[i + 1]
    ragrams.append(lowercase_    )
   if i < len(lowercase_    ) - 2:
    __lowerCAmelCase     :       Optional[int]						=   ragrams[i] + ' ' + ragrams[i + 1] + ' ' + ragrams[i + 2]
    ragrams.append(lowercase_    )
   if i < len(lowercase_    ) - 3:
    __lowerCAmelCase     :       str						=   ragrams[i] + ' ' + ragrams[i + 1] + ' ' + ragrams[i + 2] + ' ' + ragrams[i + 3]
    ragrams.append(lowercase_    )
  ragramslist.append(lowercase_    )
  ragramslist.append(lowercase_    )
  ragramslist.append(lowercase_    )

 for i in range(0    ,    len(lowercase_    ) - 1    ):
  if i < len(lowercase_    ) - 1:
   __lowerCAmelCase     :       Tuple						=   sagrams[i] + ' ' + sagrams[i + 1]
   sagrams.append(lowercase_    )
  if i < len(lowercase_    ) - 2:
   __lowerCAmelCase     :       List[Any]						=   sagrams[i] + ' ' + sagrams[i + 1] + ' ' + sagrams[i + 2]
   sagrams.append(lowercase_    )
  if i < len(lowercase_    ) - 3:
   __lowerCAmelCase     :       int						=   sagrams[i] + ' ' + sagrams[i + 1] + ' ' + sagrams[i + 2] + ' ' + sagrams[i + 3]
   sagrams.append(lowercase_    )

 for i in range(0    ,    len(lowercase_    ) - 1    ):
  if i < len(lowercase_    ) - 1:
   __lowerCAmelCase     :       str						=   cagrams[i] + ' ' + cagrams[i + 1]
   cagrams.append(lowercase_    )
  if i < len(lowercase_    ) - 2:
   __lowerCAmelCase     :       Optional[int]						=   cagrams[i] + ' ' + cagrams[i + 1] + ' ' + cagrams[i + 2]
   cagrams.append(lowercase_    )
  if i < len(lowercase_    ) - 3:
   __lowerCAmelCase     :       List[Any]						=   cagrams[i] + ' ' + cagrams[i + 1] + ' ' + cagrams[i + 2] + ' ' + cagrams[i + 3]
   cagrams.append(lowercase_    )

 (__lowerCAmelCase)     :       Any						=   SARIngram(lowercase_    ,    lowercase_    ,    lowercase_    ,    lowercase_    )
 (__lowerCAmelCase)     :       Optional[Any]						=   SARIngram(lowercase_    ,    lowercase_    ,    lowercase_    ,    lowercase_    )
 (__lowerCAmelCase)     :       Optional[int]						=   SARIngram(lowercase_    ,    lowercase_    ,    lowercase_    ,    lowercase_    )
 (__lowerCAmelCase)     :       Any						=   SARIngram(lowercase_    ,    lowercase_    ,    lowercase_    ,    lowercase_    )
 __lowerCAmelCase     :       List[Any]						=   sum([keepascore, keepascore, keepascore, keepascore]    ) / 4
 __lowerCAmelCase     :       str						=   sum([delascore, delascore, delascore, delascore]    ) / 4
 __lowerCAmelCase     :       List[str]						=   sum([addascore, addascore, addascore, addascore]    ) / 4
 __lowerCAmelCase     :       str						=   (avgkeepscore + avgdelscore + avgaddscore) / 3
 return finalscore






def        _SCREAMING_SNAKE_CASE		(			SCREAMING_SNAKE_CASE		:int    ,    SCREAMING_SNAKE_CASE		:bool = True    ,    SCREAMING_SNAKE_CASE		:str = "13a"    ,    SCREAMING_SNAKE_CASE		:bool = True    )			->    List[str]:
 # Normalization is requried for the ASSET dataset (one of the primary
 # datasets in sentence simplification) to allow using space
 # to split the sentence. Even though Wiki-Auto and TURK datasets,
 # do not require normalization, we do it for consistency.
 # Code adapted from the EASSE library [1] written by the authors of the ASSET dataset.
 # [1] https://github.com/feralvam/easse/blob/580bba7e1378fc8289c663f864e0487188fe8067/easse/utils/preprocessing.py#L7

 if lowercase:
  __lowerCAmelCase     :       Any						=   sentence.lower()

 if tokenizer in ["13a", "intl"]:
  if version.parse(sacrebleu.__version__    ).major >= 2:
   __lowerCAmelCase     :       Any						=   sacrebleu.metrics.bleu._get_tokenizer(lowercase_    )()(lowercase_    )
  else:
   __lowerCAmelCase     :       Any						=   sacrebleu.TOKENIZERS[tokenizer]()(lowercase_    )
 elif tokenizer == "moses":
  __lowerCAmelCase     :       List[Any]						=   sacremoses.MosesTokenizer().tokenize(lowercase_    ,    return_str=lowercase_    ,    escape=lowercase_    )
 elif tokenizer == "penn":
  __lowerCAmelCase     :       Optional[Any]						=   sacremoses.MosesTokenizer().penn_tokenize(lowercase_    ,    return_str=lowercase_    )
 else:
  __lowerCAmelCase     :       Tuple						=   sentence

 if not return_str:
  __lowerCAmelCase     :       Union[str, Any]						=   normalized_sent.split()

 return normalized_sent







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






  def       UpperCAmelCase__						(							self :     Optional[Any]			)->Dict:






   '''simple docstring'''

   return datasets.MetricInfo(
       description=_DESCRIPTION   ,  citation=_CITATION   ,  inputs_description=_KWARGS_DESCRIPTION   ,  features=datasets.Features(
           {
               """sources""": datasets.Value("""string"""   ,  id="""sequence"""			),
               """predictions""": datasets.Value("""string"""   ,  id="""sequence"""			),
               """references""": datasets.Sequence(datasets.Value("""string"""   ,  id="""sequence"""			)   ,  id="""references"""			),
           }			)   ,  codebase_urls=[
           """https://github.com/cocoxu/simplification/blob/master/SARI.py""",
           """https://github.com/tensorflow/tensor2tensor/blob/master/tensor2tensor/utils/sari_hook.py""",
       ]   ,  reference_urls=["""https://www.aclweb.org/anthology/Q16-1029.pdf"""]   ,  )






  def       UpperCAmelCase__						(							self :     Optional[Any]   ,  _snake_case :     Any   ,  _snake_case :     Tuple   ,  _snake_case :     Optional[int]			)->Dict:






   '''simple docstring'''

   if not (len(_snake_case			) == len(_snake_case			) == len(_snake_case			)):
    raise ValueError("""Sources length must match predictions and references lengths."""			)
   __lowerCAmelCase     :       Optional[int]						=   0
   for src, pred, refs in zip(_snake_case   ,  _snake_case   ,  _snake_case			):
    sari_score += SARIsent(normalize(_snake_case			)   ,  normalize(_snake_case			)   ,  [normalize(_snake_case			) for sent in refs]			)
   __lowerCAmelCase     :       Optional[int]						=   sari_score / len(_snake_case			)
   return {"sari": 100 * sari_score}
import os
import warnings
from pathlib import Path
from typing import Optional, Union

from .dynamic_module_utils import custom_object_save
from .tokenization_utils_base import PreTrainedTokenizerBase
from .utils import PushToHubMixin, copy_func, direct_transformers_import, logging


UpperCAmelCase							= logging.get_logger(__name__)

# Dynamically import the Transformers module to grab the attribute classes of the processor form their names.
UpperCAmelCase							= direct_transformers_import(Path(__file__).parent)


UpperCAmelCase							= {
    '''AutoTokenizer''': '''PreTrainedTokenizerBase''',
    '''AutoFeatureExtractor''': '''FeatureExtractionMixin''',
    '''AutoImageProcessor''': '''ImageProcessingMixin''',
}




class       __lowerCAmelCase     (				a_  ):



 '''simple docstring'''
 _lowerCamelCase  :		Optional[int] 			=       ['feature_extractor', 'tokenizer']
 # Names need to be attr_class for attr in attributes
 _lowerCamelCase  :		List[Any] 			=       None
 _lowerCamelCase  :		Optional[Any] 			=       None
 _lowerCamelCase  :		Tuple 			=       None

 def __init__(	self				:						Tuple				,	*lowerCamelCase				:						Optional[Any]				,	**lowerCamelCase				:						List[Any]     )       ->							str:
        # Sanitize args and kwargs
        for key in kwargs:
               if key not in self.attributes:
                      raise TypeError(f"Unexpected keyword argument {key}."     )
        for arg, attribute_name in zip(lowerCamelCase				,	self.attributes     ):
               if attribute_name in kwargs:
                      raise TypeError(f"Got multiple values for argument {attribute_name}."     )
               else:
                      _UpperCamelCase   :				Any       =     arg

        if len(lowerCamelCase     ) != len(self.attributes     ):
               raise ValueError(
                   f"This processor requires {len(self.attributes     )} arguments: {', '.join(self.attributes     )}. Got "
                   f"{len(lowerCamelCase     )} arguments instead."     )

        # Check each arg is of the proper class (this will also catch a user initializing in the wrong order)
        for attribute_name, arg in kwargs.items():
               _UpperCamelCase   :				Union[str, Any]       =     getattr(self				,	f"{attribute_name}_class"     )
               # Nothing is ever going to be an instance of "AutoXxx", in that case we check the base class.
               _UpperCamelCase   :				str       =     AUTO_TO_BASE_CLASS_MAPPING.get(lowerCamelCase				,	lowerCamelCase     )
               if isinstance(lowerCamelCase				,	lowerCamelCase     ):
                      _UpperCamelCase   :				int       =     tuple(getattr(lowerCamelCase				,	lowerCamelCase     ) for n in class_name if n is not None     )
               else:
                      _UpperCamelCase   :				Optional[int]       =     getattr(lowerCamelCase				,	lowerCamelCase     )

               if not isinstance(lowerCamelCase				,	lowerCamelCase     ):
                      raise ValueError(
                          f"Received a {type(lowerCamelCase     ).__name__} for argument {attribute_name}, but a {class_name} was expected."     )

               setattr(self				,	lowerCamelCase				,	lowerCamelCase     )

 def __repr__(	self				:						Dict     )       ->							str:
        _UpperCamelCase   :				List[str]       =     [f"- {name}: {repr(getattr(self				,	lowerCamelCase     )     )}" for name in self.attributes]
        _UpperCamelCase   :				int       =     '\n'.join(lowerCamelCase     )
        return f"{self.__class__.__name__}:\n{attributes_repr}"

 def     __snake_case    (	self				:						Tuple				,	lowerCamelCase				:						int				,	lowerCamelCase				:						bool = False				,	**lowerCamelCase				:						Optional[Any]     )       ->							Any:
        os.makedirs(lowerCamelCase				,	exist_ok=lowerCamelCase     )

        if push_to_hub:
               _UpperCamelCase   :				Optional[int]       =     kwargs.pop('commit_message'				,	lowerCamelCase     )
               _UpperCamelCase   :				List[Any]       =     kwargs.pop('repo_id'				,	save_directory.split(os.path.sep     )[-1]     )
               _UpperCamelCase   :				Optional[int]       =     self._create_repo(lowerCamelCase				,	**lowerCamelCase     )
               _UpperCamelCase   :				List[str]       =     self._get_files_timestamps(lowerCamelCase     )
        # If we have a custom config, we copy the file defining it in the folder and set the attributes so it can be
        # loaded from the Hub.
        if self._auto_class is not None:
               _UpperCamelCase   :				Optional[int]       =     [getattr(self				,	lowerCamelCase     ) for attribute_name in self.attributes]
               _UpperCamelCase   :				int       =     [(a.init_kwargs if isinstance(lowerCamelCase				,	lowerCamelCase     ) else a) for a in attrs]
               custom_object_save(self				,	lowerCamelCase				,	config=lowerCamelCase     )

        for attribute_name in self.attributes:
               _UpperCamelCase   :				int       =     getattr(self				,	lowerCamelCase     )
               # Include the processor class in the attribute config so this processor can then be reloaded with the
               # `AutoProcessor` API.
               if hasattr(lowerCamelCase				,	'_set_processor_class'     ):
                      attribute._set_processor_class(self.__class__.__name__     )
               attribute.save_pretrained(lowerCamelCase     )

        if self._auto_class is not None:
               # We added an attribute to the init_kwargs of the tokenizers, which needs to be cleaned up.
               for attribute_name in self.attributes:
                      _UpperCamelCase   :				Optional[Any]       =     getattr(self				,	lowerCamelCase     )
                      if isinstance(lowerCamelCase				,	lowerCamelCase     ):
                             del attribute.init_kwargs["auto_map"]

        if push_to_hub:
               self._upload_modified_files(
                   lowerCamelCase				,	lowerCamelCase				,	lowerCamelCase				,	commit_message=lowerCamelCase				,	token=kwargs.get('use_auth_token'     )				,	)

 @classmethod
 def     __snake_case    (	cls				:						Tuple				,	lowerCamelCase				:						Union[str, os.PathLike]				,	lowerCamelCase				:						Optional[Union[str, os.PathLike]] = None				,	lowerCamelCase				:						bool = False				,	lowerCamelCase				:						bool = False				,	lowerCamelCase				:						Optional[Union[str, bool]] = None				,	lowerCamelCase				:						str = "main"				,	**lowerCamelCase				:						Tuple				,	)       ->							Optional[Any]:
        _UpperCamelCase   :				Any       =     cache_dir
        _UpperCamelCase   :				Optional[int]       =     force_download
        _UpperCamelCase   :				int       =     local_files_only
        _UpperCamelCase   :				Dict       =     revision

        _UpperCamelCase   :				Optional[Any]       =     kwargs.pop('use_auth_token'				,	lowerCamelCase     )
        if use_auth_token is not None:
               warnings.warn(
                   'The `use_auth_token` argument is deprecated and will be removed in v5 of Transformers.'				,	lowerCamelCase     )
               if token is not None:
                      raise ValueError(
                          '`token` and `use_auth_token` are both specified. Please set only the argument `token`.'     )
               _UpperCamelCase   :				Optional[int]       =     use_auth_token

        if token is not None:
               # change to `token` in a follow-up PR
               _UpperCamelCase   :				List[Any]       =     token

        _UpperCamelCase   :				List[Any]       =     cls._get_arguments_from_pretrained(lowerCamelCase				,	**lowerCamelCase     )
        return cls(*lowerCamelCase     )

 @classmethod
 def     __snake_case    (	cls				:						Dict				,	lowerCamelCase				:						Optional[Any]="AutoProcessor"     )       ->							Optional[int]:
        if not isinstance(lowerCamelCase				,	lowerCamelCase     ):
               _UpperCamelCase   :				Tuple       =     auto_class.__name__

        import transformers.models.auto as auto_module

        if not hasattr(lowerCamelCase				,	lowerCamelCase     ):
               raise ValueError(f"{auto_class} is not a valid auto class."     )

        _UpperCamelCase   :				Union[str, Any]       =     auto_class

 @classmethod
 def     __snake_case    (	cls				:						int				,	lowerCamelCase				:						Any				,	**lowerCamelCase				:						List[Any]     )       ->							Optional[Any]:
        _UpperCamelCase   :				Optional[int]       =     []
        for attribute_name in cls.attributes:
               _UpperCamelCase   :				Dict       =     getattr(cls				,	f"{attribute_name}_class"     )
               if isinstance(lowerCamelCase				,	lowerCamelCase     ):
                      _UpperCamelCase   :				Any       =     tuple(getattr(lowerCamelCase				,	lowerCamelCase     ) if n is not None else None for n in class_name     )
                      _UpperCamelCase   :				List[Any]       =     kwargs.get('use_fast'				,	lowerCamelCase     )
                      if use_fast and classes[1] is not None:
                             _UpperCamelCase   :				Optional[int]       =     classes[1]
                      else:
                             _UpperCamelCase   :				Any       =     classes[0]
               else:
                      _UpperCamelCase   :				Any       =     getattr(lowerCamelCase				,	lowerCamelCase     )

               args.append(attribute_class.from_pretrained(lowerCamelCase				,	**lowerCamelCase     )     )
        return args

 @property
 def     __snake_case    (	self				:						List[Any]     )       ->							Optional[Any]:
        _UpperCamelCase   :				List[str]       =     getattr(self				,	self.attributes[0]     )
        return getattr(lowerCamelCase				,	'model_input_names'				,	lowerCamelCase     )







UpperCAmelCase							= copy_func(ProcessorMixin.push_to_hub)
if ProcessorMixin.push_to_hub.__doc__ is not None:
 UpperCAmelCase							= ProcessorMixin.push_to_hub.__doc__.format(
     object='''processor''', object_class='''AutoProcessor''', object_files='''processor files'''
 )



