





from __future__ import annotations







def       UpperCAmelCase							(     _lowerCamelCase      :  list[int]			,   _lowerCamelCase      :  int     ):





						'''simple docstring'''


						if len(_lowerCamelCase     ) < k or k < 0:
												raise ValueError("Invalid Input"     )
						SCREAMING_SNAKE_CASE__     :				int   =					sum(array[:k]     )
						for i in range(len(_lowerCamelCase     ) - k     ):
												SCREAMING_SNAKE_CASE__     :				str   =					current_sum - array[i] + array[i + k]
												SCREAMING_SNAKE_CASE__     :				Union[str, Any]   =					max(_lowerCamelCase			,   _lowerCamelCase     )
						return max_sum


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

				testmod()
				__lowercase       =  [randint(-1_000, 1_000) for i in range(100)]
				__lowercase       =  randint(0, 110)
				print(f"The maximum sum of {k} consecutive elements is {max_sum_in_array(array,k)}")






from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


__lowercase       :str       =  {
    "configuration_upernet": ["UperNetConfig"],
}

try:
				if not is_torch_available():
								raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
				pass
else:
				__lowercase       :Union[str, Any]       =  [
				    "UperNetForSemanticSegmentation",
				    "UperNetPreTrainedModel",
				]


if TYPE_CHECKING:
				from .configuration_upernet import UperNetConfig

				try:
								if not is_torch_available():
												raise OptionalDependencyNotAvailable()
				except OptionalDependencyNotAvailable:
								pass
				else:
								from .modeling_upernet import UperNetForSemanticSegmentation, UperNetPreTrainedModel


else:
				import sys

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