





from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


lowercase_					     =	{
    """configuration_electra""": ["""ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP""", """ElectraConfig""", """ElectraOnnxConfig"""],
    """tokenization_electra""": ["""ElectraTokenizer"""],
}

try:
 if not is_tokenizers_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowercase_					     =	["""ElectraTokenizerFast"""]

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowercase_					     =	[
     """ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST""",
     """ElectraForCausalLM""",
     """ElectraForMaskedLM""",
     """ElectraForMultipleChoice""",
     """ElectraForPreTraining""",
     """ElectraForQuestionAnswering""",
     """ElectraForSequenceClassification""",
     """ElectraForTokenClassification""",
     """ElectraModel""",
     """ElectraPreTrainedModel""",
     """load_tf_weights_in_electra""",
 ]

try:
 if not is_tf_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowercase_					     =	[
     """TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST""",
     """TFElectraForMaskedLM""",
     """TFElectraForMultipleChoice""",
     """TFElectraForPreTraining""",
     """TFElectraForQuestionAnswering""",
     """TFElectraForSequenceClassification""",
     """TFElectraForTokenClassification""",
     """TFElectraModel""",
     """TFElectraPreTrainedModel""",
 ]

try:
 if not is_flax_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 lowercase_					     =	[
     """FlaxElectraForCausalLM""",
     """FlaxElectraForMaskedLM""",
     """FlaxElectraForMultipleChoice""",
     """FlaxElectraForPreTraining""",
     """FlaxElectraForQuestionAnswering""",
     """FlaxElectraForSequenceClassification""",
     """FlaxElectraForTokenClassification""",
     """FlaxElectraModel""",
     """FlaxElectraPreTrainedModel""",
 ]


if TYPE_CHECKING:
 from .configuration_electra import ELECTRA_PRETRAINED_CONFIG_ARCHIVE_MAP, ElectraConfig, ElectraOnnxConfig
 from .tokenization_electra import ElectraTokenizer

 try:
  if not is_tokenizers_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .tokenization_electra_fast import ElectraTokenizerFast

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_electra import (
      ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST,
      ElectraForCausalLM,
      ElectraForMaskedLM,
      ElectraForMultipleChoice,
      ElectraForPreTraining,
      ElectraForQuestionAnswering,
      ElectraForSequenceClassification,
      ElectraForTokenClassification,
      ElectraModel,
      ElectraPreTrainedModel,
      load_tf_weights_in_electra,
  )

 try:
  if not is_tf_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_tf_electra import (
      TF_ELECTRA_PRETRAINED_MODEL_ARCHIVE_LIST,
      TFElectraForMaskedLM,
      TFElectraForMultipleChoice,
      TFElectraForPreTraining,
      TFElectraForQuestionAnswering,
      TFElectraForSequenceClassification,
      TFElectraForTokenClassification,
      TFElectraModel,
      TFElectraPreTrainedModel,
  )

 try:
  if not is_flax_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_flax_electra import (
      FlaxElectraForCausalLM,
      FlaxElectraForMaskedLM,
      FlaxElectraForMultipleChoice,
      FlaxElectraForPreTraining,
      FlaxElectraForQuestionAnswering,
      FlaxElectraForSequenceClassification,
      FlaxElectraForTokenClassification,
      FlaxElectraModel,
      FlaxElectraPreTrainedModel,
  )

else:
 import sys

 lowercase_					     =	_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)









from string import ascii_uppercase

lowercase_					     =	{str(ord(c) - 55): c for c in ascii_uppercase}




def     __UpperCamelCase						(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	)       ->     str:
  if isinstance(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	):
    raise TypeError('int() can\'t convert non-string with explicit base'	)
  if num < 0:
    raise ValueError('parameter must be positive int'	)
  if isinstance(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	):
    raise TypeError('\'str\' object cannot be interpreted as an integer'	)
  if isinstance(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	):
    raise TypeError('\'float\' object cannot be interpreted as an integer'	)
  if base in (0, 1):
    raise ValueError('base must be >= 2'	)
  if base > 36:
    raise ValueError('base must be <= 36'	)
  lowercase__			    =						''
  lowercase__			    =						0
  lowercase__			    =						0
  while div != 1:
    lowercase__    ,					lowercase__			    =						divmod(_SCREAMING_SNAKE_CASE	,		_SCREAMING_SNAKE_CASE	)
    if base >= 11 and 9 < mod < 36:
      lowercase__			    =						ALPHABET_VALUES[str(_SCREAMING_SNAKE_CASE	)]
    else:
      lowercase__			    =						str(_SCREAMING_SNAKE_CASE	)
    new_value += actual_value
    lowercase__			    =						num // base
    lowercase__			    =						div
    if div == 0:
      return str(new_value[::-1]	)
    elif div == 1:
      new_value += str(_SCREAMING_SNAKE_CASE	)
      return str(new_value[::-1]	)

  return new_value[::-1]


if __name__ == "__main__":
      import doctest

      doctest.testmod()

      for base in range(2, 37):
            for num in range(1_000):
                  assert int(decimal_to_any(num, base), base) == num, (
                      num,
                      base,
                      decimal_to_any(num, base),
                      int(decimal_to_any(num, base), base),
                  )


