



'''simple docstring'''




from typing import TYPE_CHECKING

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


a     :    Optional[Any]      						=					{
    """configuration_pix2struct""": [
        """PIX2STRUCT_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """Pix2StructConfig""",
        """Pix2StructTextConfig""",
        """Pix2StructVisionConfig""",
    ],
    """processing_pix2struct""": ["""Pix2StructProcessor"""],
}

try:
							if not is_vision_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							a     :    List[str]      						=					["""Pix2StructImageProcessor"""]


try:
							if not is_torch_available():
														raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
							pass
else:
							a     :    List[Any]      						=					[
							    """PIX2STRUCT_PRETRAINED_MODEL_ARCHIVE_LIST""",
							    """Pix2StructPreTrainedModel""",
							    """Pix2StructForConditionalGeneration""",
							    """Pix2StructVisionModel""",
							    """Pix2StructTextModel""",
							]

if TYPE_CHECKING:
							from .configuration_pixastruct import (
							    PIX2STRUCT_PRETRAINED_CONFIG_ARCHIVE_MAP,
							    PixaStructConfig,
							    PixaStructTextConfig,
							    PixaStructVisionConfig,
							)
							from .processing_pixastruct import PixaStructProcessor

							try:
														if not is_vision_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .image_processing_pixastruct import PixaStructImageProcessor

							try:
														if not is_torch_available():
																					raise OptionalDependencyNotAvailable()
							except OptionalDependencyNotAvailable:
														pass
							else:
														from .modeling_pixastruct import (
														    PIX2STRUCT_PRETRAINED_MODEL_ARCHIVE_LIST,
														    PixaStructForConditionalGeneration,
														    PixaStructPreTrainedModel,
														    PixaStructTextModel,
														    PixaStructVisionModel,
														)

else:
							import sys

							a     :    Union[str, Any]      						=					_LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)






'''simple docstring'''




a     :    Tuple      						=					[sum(int(c, 1_0) ** 2 for c in i.__str__()) for i in range(1_0_0_0_0_0)]



def    __lowerCamelCase						(      _lowercase	)   ->    int:
							UpperCAmelCase  :	str							  =	0
							while number:
														# Increased Speed Slightly by checking every 5 digits together.
														sum_of_digits_squared += DIGITS_SQUARED[number % 1_0_0_0_0_0]
														number //= 1_0_0_0_0_0

							return sum_of_digits_squared


# There are 2 Chains made,
# One ends with 89 with the chain member 58 being the one which when declared first,
# there will be the least number of iterations for all the members to be checked.

# The other one ends with 1 and has only one element 1.

# So 58 and 1 are chosen to be declared at the starting.

# Changed dictionary to an array to quicken the solution
a     :    list[bool | None]      						=					[None] * 1_0_0_0_0_0_0_0
a     :    Optional[Any]      						=					True
a     :    List[Any]      						=					False



def    __lowerCamelCase						(      _lowercase	)   ->    bool:

							if CHAINS[number - 1] is not None:
														return CHAINS[number - 1]  # type: ignore

							UpperCAmelCase  :	List[str]							  =	chain(next_number(_lowercase	)	)
							UpperCAmelCase  :	Tuple							  =	number_chain

							while number < 1_0_0_0_0_0_0_0:
														UpperCAmelCase  :	List[str]							  =	number_chain
														number *= 1_0

							return number_chain



def    __lowerCamelCase						(      _lowercase = 1_0_0_0_0_0_0_0	)   ->    int:
							for i in range(1			,       _lowercase	):
														if CHAINS[i] is None:
																					chain(i + 1	)

							return CHAINS[:number].count(_lowercase	)


if __name__ == "__main__":
							import doctest

							doctest.testmod()
							print(F'''{solution() = }''')

