


"""simple docstring"""


from __future__ import annotations







def  __snake_case       (   UpperCamelCase__ ,			UpperCamelCase__	)      ->		Tuple:







		"""simple docstring"""





		if len(lowerCAmelCase_	) < k or k < 0:
				raise ValueError('Invalid Input'	)
		A					       = sum(array[:k]	)
		for i in range(len(lowerCAmelCase_	) - k	):
				A					       = current_sum - array[i] + array[i + k]
				A					       = max(lowerCAmelCase_ ,			lowerCAmelCase_	)
		return max_sum


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

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









"""simple docstring"""


import unittest

from diffusers.pipelines.pipeline_utils import is_safetensors_compatible



class 			lowerCamelCase__						(   unittest.TestCase			):







						def __a						(							self   :    Dict		):
								A					       = [
								    'safety_checker/pytorch_model.bin',
								    'safety_checker/model.safetensors',
								    'vae/diffusion_pytorch_model.bin',
								    'vae/diffusion_pytorch_model.safetensors',
								    'text_encoder/pytorch_model.bin',
								    'text_encoder/model.safetensors',
								    'unet/diffusion_pytorch_model.bin',
								    'unet/diffusion_pytorch_model.safetensors',
								]
								self.assertTrue(is_safetensors_compatible(_lowercase		)		)







						def __a						(							self   :    Union[str, Any]		):
								A					       = [
								    'unet/diffusion_pytorch_model.bin',
								    'unet/diffusion_pytorch_model.safetensors',
								]
								self.assertTrue(is_safetensors_compatible(_lowercase		)		)







						def __a						(							self   :    int		):
								A					       = [
								    'safety_checker/pytorch_model.bin',
								    'safety_checker/model.safetensors',
								    'vae/diffusion_pytorch_model.bin',
								    'vae/diffusion_pytorch_model.safetensors',
								    'text_encoder/pytorch_model.bin',
								    'text_encoder/model.safetensors',
								    'unet/diffusion_pytorch_model.bin',
								    # Removed: 'unet/diffusion_pytorch_model.safetensors',
								]
								self.assertFalse(is_safetensors_compatible(_lowercase		)		)







						def __a						(							self   :    Dict		):
								A					       = [
								    'text_encoder/pytorch_model.bin',
								    'text_encoder/model.safetensors',
								]
								self.assertTrue(is_safetensors_compatible(_lowercase		)		)







						def __a						(							self   :    Union[str, Any]		):
								A					       = [
								    'safety_checker/pytorch_model.bin',
								    'safety_checker/model.safetensors',
								    'vae/diffusion_pytorch_model.bin',
								    'vae/diffusion_pytorch_model.safetensors',
								    'text_encoder/pytorch_model.bin',
								    # Removed: 'text_encoder/model.safetensors',
								    'unet/diffusion_pytorch_model.bin',
								    'unet/diffusion_pytorch_model.safetensors',
								]
								self.assertFalse(is_safetensors_compatible(_lowercase		)		)







						def __a						(							self   :    Any		):
								A					       = [
								    'safety_checker/pytorch_model.fp16.bin',
								    'safety_checker/model.fp16.safetensors',
								    'vae/diffusion_pytorch_model.fp16.bin',
								    'vae/diffusion_pytorch_model.fp16.safetensors',
								    'text_encoder/pytorch_model.fp16.bin',
								    'text_encoder/model.fp16.safetensors',
								    'unet/diffusion_pytorch_model.fp16.bin',
								    'unet/diffusion_pytorch_model.fp16.safetensors',
								]
								A					       = 'fp16'
								self.assertTrue(is_safetensors_compatible(_lowercase			,			variant=_lowercase		)		)







						def __a						(							self   :    Union[str, Any]		):
								A					       = [
								    'unet/diffusion_pytorch_model.fp16.bin',
								    'unet/diffusion_pytorch_model.fp16.safetensors',
								]
								A					       = 'fp16'
								self.assertTrue(is_safetensors_compatible(_lowercase			,			variant=_lowercase		)		)







						def __a						(							self   :    Optional[Any]		):
								# pass variant but use the non-variant filenames
								A					       = [
								    'unet/diffusion_pytorch_model.bin',
								    'unet/diffusion_pytorch_model.safetensors',
								]
								A					       = 'fp16'
								self.assertTrue(is_safetensors_compatible(_lowercase			,			variant=_lowercase		)		)







						def __a						(							self   :    Dict		):
								A					       = [
								    'safety_checker/pytorch_model.fp16.bin',
								    'safety_checker/model.fp16.safetensors',
								    'vae/diffusion_pytorch_model.fp16.bin',
								    'vae/diffusion_pytorch_model.fp16.safetensors',
								    'text_encoder/pytorch_model.fp16.bin',
								    'text_encoder/model.fp16.safetensors',
								    'unet/diffusion_pytorch_model.fp16.bin',
								    # Removed: 'unet/diffusion_pytorch_model.fp16.safetensors',
								]
								A					       = 'fp16'
								self.assertFalse(is_safetensors_compatible(_lowercase			,			variant=_lowercase		)		)







						def __a						(							self   :    Dict		):
								A					       = [
								    'text_encoder/pytorch_model.fp16.bin',
								    'text_encoder/model.fp16.safetensors',
								]
								A					       = 'fp16'
								self.assertTrue(is_safetensors_compatible(_lowercase			,			variant=_lowercase		)		)







						def __a						(							self   :    Any		):
								# pass variant but use the non-variant filenames
								A					       = [
								    'text_encoder/pytorch_model.bin',
								    'text_encoder/model.safetensors',
								]
								A					       = 'fp16'
								self.assertTrue(is_safetensors_compatible(_lowercase			,			variant=_lowercase		)		)







						def __a						(							self   :    List[str]		):
								A					       = [
								    'safety_checker/pytorch_model.fp16.bin',
								    'safety_checker/model.fp16.safetensors',
								    'vae/diffusion_pytorch_model.fp16.bin',
								    'vae/diffusion_pytorch_model.fp16.safetensors',
								    'text_encoder/pytorch_model.fp16.bin',
								    # 'text_encoder/model.fp16.safetensors',
								    'unet/diffusion_pytorch_model.fp16.bin',
								    'unet/diffusion_pytorch_model.fp16.safetensors',
								]
								A					       = 'fp16'
								self.assertFalse(is_safetensors_compatible(_lowercase			,			variant=_lowercase		)		)





