
from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


_snake_case      = {
    '''configuration_jukebox''': [
        '''JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP''',
        '''JukeboxConfig''',
        '''JukeboxPriorConfig''',
        '''JukeboxVQVAEConfig''',
    ],
    '''tokenization_jukebox''': ['''JukeboxTokenizer'''],
}

try:
 if not is_torch_available():
  raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
 pass
else:
 _snake_case      = [
     '''JUKEBOX_PRETRAINED_MODEL_ARCHIVE_LIST''',
     '''JukeboxModel''',
     '''JukeboxPreTrainedModel''',
     '''JukeboxVQVAE''',
     '''JukeboxPrior''',
 ]

if TYPE_CHECKING:
 from .configuration_jukebox import (
     JUKEBOX_PRETRAINED_CONFIG_ARCHIVE_MAP,
     JukeboxConfig,
     JukeboxPriorConfig,
     JukeboxVQVAEConfig,
 )
 from .tokenization_jukebox import JukeboxTokenizer

 try:
  if not is_torch_available():
   raise OptionalDependencyNotAvailable()
 except OptionalDependencyNotAvailable:
  pass
 else:
  from .modeling_jukebox import (
      JUKEBOX_PRETRAINED_MODEL_ARCHIVE_LIST,
      JukeboxModel,
      JukeboxPreTrainedModel,
      JukeboxPrior,
      JukeboxVQVAE,
  )

else:
 import sys

 _snake_case      = _LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)




from decimal import Decimal, getcontext
from math import ceil, factorial

def  __lowerCamelCase					( _lowercase			)       ->      str:

     if not isinstance(_lowercase						,     _lowercase			):
          raise TypeError('Undefined for non-integers'			)
     elif precision < 1:
          raise ValueError('Undefined for non-natural numbers'			)

     UpperCamelCase						    =					precision
     UpperCamelCase						    =					ceil(precision / 14			)
     UpperCamelCase						    =					426880 * Decimal(10005			).sqrt()
     UpperCamelCase						    =					1
     UpperCamelCase						    =					13591409
     UpperCamelCase						    =					Decimal(_lowercase			)
     for k in range(1						,     _lowercase			):
          UpperCamelCase						    =					factorial(6 * k			) // (factorial(3 * k			) * factorial(_lowercase			) ** 3)
          linear_term += 545140134
          exponential_term *= -262537412640768000
          partial_sum += Decimal(multinomial_term * linear_term			) / exponential_term
     return str(constant_term / partial_sum			)[:-1]


if __name__ == "__main__":
 _snake_case      = 50
 print(F"The first {n} digits of pi is: {pi(n)}")


