





from typing import TYPE_CHECKING

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


UpperCAmelCase_ 							=       {
    """configuration_vision_text_dual_encoder""": ["""VisionTextDualEncoderConfig"""],
    """processing_vision_text_dual_encoder""": ["""VisionTextDualEncoderProcessor"""],
}


try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					UpperCAmelCase_ 							=       ["""VisionTextDualEncoderModel"""]


try:
					if not is_flax_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					UpperCAmelCase_ 							=       ["""FlaxVisionTextDualEncoderModel"""]

try:
					if not is_tf_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					UpperCAmelCase_ 							=       ["""TFVisionTextDualEncoderModel"""]


if TYPE_CHECKING:
					from .configuration_vision_text_dual_encoder import VisionTextDualEncoderConfig
					from .processing_vision_text_dual_encoder import VisionTextDualEncoderProcessor

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_vision_text_dual_encoder import VisionTextDualEncoderModel

					try:
										if not is_flax_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_flax_vision_text_dual_encoder import FlaxVisionTextDualEncoderModel

					try:
										if not is_tf_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_tf_vision_text_dual_encoder import TFVisionTextDualEncoderModel


else:
					import sys

					UpperCAmelCase_ 							=       _LazyModule(__name__, globals()["""__file__"""], _import_structure)










from collections.abc import Sequence





def   lowerCamelCase__       (       UpperCamelCase__     :    Sequence[float]    ,      UpperCamelCase__     :    bool = False  )     ->	float:



					'''simple docstring'''




					if not arr:
										return 0

					_snake_case													=			0 if allow_empty_subarrays else float('-inf'  )
					_snake_case													=			0.0
					for num in arr:
										_snake_case													=			max(0 if allow_empty_subarrays else num    ,      curr_sum + num  )
										_snake_case													=			max(UpperCamelCase__    ,      UpperCamelCase__  )

					return max_sum


if __name__ == "__main__":
					from doctest import testmod

					testmod()

					UpperCAmelCase_ 							=       [-2, 1, -3, 4, -1, 2, 1, -5, 4]
					print(F"{max_subarray_sum(nums) = }")



