"""simple docstring"""




from typing import TYPE_CHECKING

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


__lowerCamelCase									=	{
    """configuration_imagegpt""": ["""IMAGEGPT_PRETRAINED_CONFIG_ARCHIVE_MAP""", """ImageGPTConfig""", """ImageGPTOnnxConfig"""]
}

try:
				if not is_vision_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				__lowerCamelCase									=	["""ImageGPTFeatureExtractor"""]
				__lowerCamelCase									=	["""ImageGPTImageProcessor"""]

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				__lowerCamelCase									=	[
				    """IMAGEGPT_PRETRAINED_MODEL_ARCHIVE_LIST""",
				    """ImageGPTForCausalImageModeling""",
				    """ImageGPTForImageClassification""",
				    """ImageGPTModel""",
				    """ImageGPTPreTrainedModel""",
				    """load_tf_weights_in_imagegpt""",
				]


if TYPE_CHECKING:
				from .configuration_imagegpt import IMAGEGPT_PRETRAINED_CONFIG_ARCHIVE_MAP, ImageGPTConfig, ImageGPTOnnxConfig

				try:
								if not is_vision_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .feature_extraction_imagegpt import ImageGPTFeatureExtractor
								from .image_processing_imagegpt import ImageGPTImageProcessor

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_imagegpt import (
								    IMAGEGPT_PRETRAINED_MODEL_ARCHIVE_LIST,
								    ImageGPTForCausalImageModeling,
								    ImageGPTForImageClassification,
								    ImageGPTModel,
								    ImageGPTPreTrainedModel,
								    load_tf_weights_in_imagegpt,
								)

else:
				import sys

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











'''simple docstring'''
def 							snake_case_    (  a__						:      int     ):



    """simple docstring"""




    __lowercase     							=		1
    __lowercase     							=		0
    __lowercase     							=		1
    __lowercase     							=		1
    __lowercase     							=		3
    __lowercase     							=		3
    __lowercase     							=		limit
    __lowercase     							=		0

    __lowercase     							=		""""""
    while counter != decimal + 1:
        if 4 * q + r - t < n * t:
            result += str(a__     )
            if counter == 0:
                result += "."

            if decimal == counter:
                break

            counter += 1
            __lowercase     							=		10 * (r - n * t)
            __lowercase     							=		((10 * (3 * q + r)) // t) - 10 * n
            q *= 10
            __lowercase     							=		nr
        else:
            __lowercase     							=		(2 * q + r) * l
            __lowercase     							=		(q * (7 * k) + 2 + (r * l)) // (t * l)
            q *= k
            t *= l
            l += 2
            k += 1
            __lowercase     							=		nn
            __lowercase     							=		nr
    return result
def 							snake_case_    (  ):



    """simple docstring"""




    print(f'{calculate_pi(50     ) = }'     )
    import doctest

    doctest.testmod()


if __name__ == "__main__":
  main()




