"""simple docstring"""






from ctypes import c_float, sizeof
from enum import Enum
from typing import TYPE_CHECKING, Optional, Union


if TYPE_CHECKING:
       from .. import AutoFeatureExtractor, AutoProcessor, AutoTokenizer  # tests_ignore


class 					UpperCAmelCase		(_UpperCAmelCase						):



    """simple docstring"""

    _UpperCAmelCase			:int							=				c_float






    @property
    def _snake_case    (     self							):
       return sizeof(self.value							)



def SCREAMING_SNAKE_CASE__    (     __UpperCAmelCase ,					__UpperCAmelCase ,					__UpperCAmelCase = 0				):
   # < 0 is possible if using a dynamic axis
   if dimension <= 0:
      lowercase__:     List[str]      =   fixed_dimension

   dimension -= num_token_to_add
   return dimension



def SCREAMING_SNAKE_CASE__    (     __UpperCAmelCase ,					__UpperCAmelCase				):
   return num_parameters * dtype.size




def SCREAMING_SNAKE_CASE__    (     __UpperCAmelCase				):
   from .. import AutoFeatureExtractor, AutoProcessor, AutoTokenizer  # tests_ignore

   try:
      return AutoProcessor.from_pretrained(__UpperCAmelCase				)
   except (ValueError, OSError, KeyError):
      lowercase__:     Any      =   None, None
      try:
         lowercase__:     Dict      =   AutoTokenizer.from_pretrained(__UpperCAmelCase				)
      except (OSError, KeyError):
         pass
      try:
         lowercase__:     Optional[Any]      =   AutoFeatureExtractor.from_pretrained(__UpperCAmelCase				)
      except (OSError, KeyError):
         pass

      if tokenizer is not None and feature_extractor is not None:
         raise ValueError(
             F"""Couldn't auto-detect preprocessor for {model_name}. Found both a tokenizer and a feature extractor."""				)
      elif tokenizer is None and feature_extractor is None:
         return None
      elif tokenizer is not None:
         return tokenizer
      else:
         return feature_extractor

"""simple docstring"""






def SCREAMING_SNAKE_CASE__    (     __UpperCAmelCase				)						->						int:
   if not isinstance(__UpperCAmelCase ,					__UpperCAmelCase				):
      lowercase__:     Optional[int]      =   F"""Input value of [number={number}] must be an integer"""
      raise TypeError(__UpperCAmelCase				)
   if number < 1:
      raise ValueError('''Input must be a positive integer'''				)
   return number * (2 * number - 1)


if __name__ == "__main__":
       import doctest

       doctest.testmod()
