






'''simple docstring'''







from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_torch_available,
    is_vision_available,
)


_A	:			Dict         ={'''configuration_beit''': ['''BEIT_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''BeitConfig''', '''BeitOnnxConfig''']}

try:
			if not is_vision_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			_A	:			Union[str, Any]         =['''BeitFeatureExtractor''']
			_A	:			Union[str, Any]         =['''BeitImageProcessor''']

try:
			if not is_torch_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			_A	:			str         =[
			    '''BEIT_PRETRAINED_MODEL_ARCHIVE_LIST''',
			    '''BeitForImageClassification''',
			    '''BeitForMaskedImageModeling''',
			    '''BeitForSemanticSegmentation''',
			    '''BeitModel''',
			    '''BeitPreTrainedModel''',
			]


try:
			if not is_flax_available():
						raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
			pass
else:
			_A	:			Tuple         =[
			    '''FlaxBeitForImageClassification''',
			    '''FlaxBeitForMaskedImageModeling''',
			    '''FlaxBeitModel''',
			    '''FlaxBeitPreTrainedModel''',
			]

if TYPE_CHECKING:
			from .configuration_beit import BEIT_PRETRAINED_CONFIG_ARCHIVE_MAP, BeitConfig, BeitOnnxConfig

			try:
						if not is_vision_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .feature_extraction_beit import BeitFeatureExtractor
						from .image_processing_beit import BeitImageProcessor

			try:
						if not is_torch_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_beit import (
						    BEIT_PRETRAINED_MODEL_ARCHIVE_LIST,
						    BeitForImageClassification,
						    BeitForMaskedImageModeling,
						    BeitForSemanticSegmentation,
						    BeitModel,
						    BeitPreTrainedModel,
						)

			try:
						if not is_flax_available():
									raise OptionalDependencyNotAvailable()
			except OptionalDependencyNotAvailable:
						pass
			else:
						from .modeling_flax_beit import (
						    FlaxBeitForImageClassification,
						    FlaxBeitForMaskedImageModeling,
						    FlaxBeitModel,
						    FlaxBeitPreTrainedModel,
						)


else:
			import sys

			_A	:			Optional[int]         =_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)









'''simple docstring'''







class _lowercase	:




							def __init__(							self:				Tuple			,							UpperCamelCase__:				list[int]     ):
														lowerCamelCase__					:	Union[str, Any]         =       len(UpperCamelCase__     )
														lowerCamelCase__					:	Union[str, Any]         =       [0] * len_array

														if len_array > 0:
																					lowerCamelCase__					:	Union[str, Any]         =       array[0]

														for i in range(1			,							UpperCamelCase__     ):
																					lowerCamelCase__					:	Tuple         =       self.prefix_sum[i - 1] + array[i]




							def 		lowerCamelCase_				(							self:				Tuple			,							UpperCamelCase__:				int			,							UpperCamelCase__:				int     ):
														if start == 0:
																					return self.prefix_sum[end]

														return self.prefix_sum[end] - self.prefix_sum[start - 1]




							def 		lowerCamelCase_				(							self:				Optional[int]			,							UpperCamelCase__:				int     ):
														lowerCamelCase__					:	Dict         =       {0}
														for sum_item in self.prefix_sum:
																					if sum_item - target_sum in sums:
																												return True

																					sums.add(UpperCamelCase__     )

														return False


if __name__ == "__main__":
			import doctest

			doctest.testmod()

