
import math
from timeit import timeit





def 					_a      (		lowerCamelCase							):
 lowerCamelCase	:			Optional[int]           =   0
 lowerCamelCase	:			int           =   abs(lowerCamelCase							)
 while True:
  lowerCamelCase	:			List[str]           =   n // 10
  digits += 1
  if n == 0:
   break
 return digits





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





def 					_a      (		lowerCamelCase							):
 return len(str(abs(lowerCamelCase							)							)							)





def 					_a      (		):
 from collections.abc import Callable

 def benchmark_a_function(lowerCamelCase,			lowerCamelCase							) -> None:
  lowerCamelCase	:			Dict           =   F'''{func.__name__}({value})'''
  lowerCamelCase	:			List[str]           =   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()






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_lowerCamelCase           ={
    """configuration_musicgen""": [
        """MUSICGEN_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """MusicgenConfig""",
        """MusicgenDecoderConfig""",
    ],
    """processing_musicgen""": ["""MusicgenProcessor"""],
}

try:
      if not is_torch_available():
            raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
      pass
else:
      _lowerCamelCase           =[
          """MUSICGEN_PRETRAINED_MODEL_ARCHIVE_LIST""",
          """MusicgenForConditionalGeneration""",
          """MusicgenForCausalLM""",
          """MusicgenModel""",
          """MusicgenPreTrainedModel""",
      ]

if TYPE_CHECKING:
      from .configuration_musicgen import (
          MUSICGEN_PRETRAINED_CONFIG_ARCHIVE_MAP,
          MusicgenConfig,
          MusicgenDecoderConfig,
      )
      from .processing_musicgen import MusicgenProcessor

      try:
            if not is_torch_available():
                  raise OptionalDependencyNotAvailable()
      except OptionalDependencyNotAvailable:
            pass
      else:
            from .modeling_musicgen import (
                MUSICGEN_PRETRAINED_MODEL_ARCHIVE_LIST,
                MusicgenForCausalLM,
                MusicgenForConditionalGeneration,
                MusicgenModel,
                MusicgenPreTrainedModel,
            )

else:
      import sys

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




