





'''simple docstring'''

from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_tf_available, is_torch_available


lowercase_			       =				{
    """configuration_esm""": ["""ESM_PRETRAINED_CONFIG_ARCHIVE_MAP""", """EsmConfig"""],
    """tokenization_esm""": ["""EsmTokenizer"""],
}

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      lowercase_			       =				[
          """ESM_PRETRAINED_MODEL_ARCHIVE_LIST""",
          """EsmForMaskedLM""",
          """EsmForSequenceClassification""",
          """EsmForTokenClassification""",
          """EsmModel""",
          """EsmPreTrainedModel""",
      ]
      lowercase_			       =				["""EsmForProteinFolding""", """EsmFoldPreTrainedModel"""]

try:
      if not is_tf_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      lowercase_			       =				[
          """TF_ESM_PRETRAINED_MODEL_ARCHIVE_LIST""",
          """TFEsmForMaskedLM""",
          """TFEsmForSequenceClassification""",
          """TFEsmForTokenClassification""",
          """TFEsmModel""",
          """TFEsmPreTrainedModel""",
      ]

if TYPE_CHECKING:
      from .configuration_esm import ESM_PRETRAINED_CONFIG_ARCHIVE_MAP, EsmConfig
      from .tokenization_esm import EsmTokenizer

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_esm import (
                ESM_PRETRAINED_MODEL_ARCHIVE_LIST,
                EsmForMaskedLM,
                EsmForSequenceClassification,
                EsmForTokenClassification,
                EsmModel,
                EsmPreTrainedModel,
            )
            from .modeling_esmfold import EsmFoldPreTrainedModel, EsmForProteinFolding

      try:
            if not is_tf_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_tf_esm import (
                TF_ESM_PRETRAINED_MODEL_ARCHIVE_LIST,
                TFEsmForMaskedLM,
                TFEsmForSequenceClassification,
                TFEsmForTokenClassification,
                TFEsmModel,
                TFEsmPreTrainedModel,
            )


else:
      import sys

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










'''simple docstring'''

import math
from timeit import timeit





def lowerCamelCase		(  __lowerCamelCase				:					int					)		->int:
    _SCREAMING_SNAKE_CASE             =    0
    _SCREAMING_SNAKE_CASE             =    abs(__lowerCamelCase					)
    while True:
        _SCREAMING_SNAKE_CASE             =    n // 10
        digits += 1
        if n == 0:
            break
    return digits





def lowerCamelCase		(  __lowerCamelCase				:					int					)		->int:
    return 1 if n == 0 else math.floor(math.log(abs(__lowerCamelCase					)      , 10					) + 1					)





def lowerCamelCase		(  __lowerCamelCase				:					int					)		->int:
    return len(str(abs(__lowerCamelCase					)					)					)





def lowerCamelCase		(  )		->None:
    from collections.abc import Callable

    def benchmark_a_function(__lowerCamelCase				:					Callable      , __lowerCamelCase				:					int					) -> None:
        _SCREAMING_SNAKE_CASE             =    F'{func.__name__}({value})'
        _SCREAMING_SNAKE_CASE             =    timeit(F'__main__.{call}'      , setup="""import __main__"""					)
        print(F'{call}: {func(__lowerCamelCase					)} -- {timing} seconds'					)

    for value in (26_2144, 1125_8999_0684_2624, 126_7650_6002_2822_9401_4967_0320_5376):
        for func in (num_digits, num_digits_fast, num_digits_faster):
            benchmark_a_function(__lowerCamelCase      , __lowerCamelCase					)
        print()


if __name__ == "__main__":
      import doctest

      doctest.testmod()
      benchmark()



