

import unittest

from diffusers.pipelines.pipeline_utils import is_safetensors_compatible

class 						__UpperCamelCase    (					unittest.TestCase						):




 def       __A					(		self	:						Any							):


  '''simple docstring'''







  UpperCAmelCase_       				=			[
      '''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(lowerCamelCase__							)							)




 def       __A					(		self	:						List[str]							):


  '''simple docstring'''







  UpperCAmelCase_       				=			[
      '''unet/diffusion_pytorch_model.bin''',
      '''unet/diffusion_pytorch_model.safetensors''',
  ]
  self.assertTrue(is_safetensors_compatible(lowerCamelCase__							)							)




 def       __A					(		self	:						List[Any]							):


  '''simple docstring'''







  UpperCAmelCase_       				=			[
      '''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(lowerCamelCase__							)							)




 def       __A					(		self	:						List[str]							):


  '''simple docstring'''







  UpperCAmelCase_       				=			[
      '''text_encoder/pytorch_model.bin''',
      '''text_encoder/model.safetensors''',
  ]
  self.assertTrue(is_safetensors_compatible(lowerCamelCase__							)							)




 def       __A					(		self	:						Optional[int]							):


  '''simple docstring'''







  UpperCAmelCase_       				=			[
      '''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(lowerCamelCase__							)							)




 def       __A					(		self	:						int							):


  '''simple docstring'''







  UpperCAmelCase_       				=			[
      '''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''',
  ]
  UpperCAmelCase_       				=			'''fp16'''
  self.assertTrue(is_safetensors_compatible(lowerCamelCase__		,	variant=lowerCamelCase__							)							)




 def       __A					(		self	:						Dict							):


  '''simple docstring'''







  UpperCAmelCase_       				=			[
      '''unet/diffusion_pytorch_model.fp16.bin''',
      '''unet/diffusion_pytorch_model.fp16.safetensors''',
  ]
  UpperCAmelCase_       				=			'''fp16'''
  self.assertTrue(is_safetensors_compatible(lowerCamelCase__		,	variant=lowerCamelCase__							)							)




 def       __A					(		self	:						List[str]							):


  '''simple docstring'''







  UpperCAmelCase_       				=			[
      '''unet/diffusion_pytorch_model.bin''',
      '''unet/diffusion_pytorch_model.safetensors''',
  ]
  UpperCAmelCase_       				=			'''fp16'''
  self.assertTrue(is_safetensors_compatible(lowerCamelCase__		,	variant=lowerCamelCase__							)							)




 def       __A					(		self	:						Tuple							):


  '''simple docstring'''







  UpperCAmelCase_       				=			[
      '''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',
  ]
  UpperCAmelCase_       				=			'''fp16'''
  self.assertFalse(is_safetensors_compatible(lowerCamelCase__		,	variant=lowerCamelCase__							)							)




 def       __A					(		self	:						Optional[int]							):


  '''simple docstring'''







  UpperCAmelCase_       				=			[
      '''text_encoder/pytorch_model.fp16.bin''',
      '''text_encoder/model.fp16.safetensors''',
  ]
  UpperCAmelCase_       				=			'''fp16'''
  self.assertTrue(is_safetensors_compatible(lowerCamelCase__		,	variant=lowerCamelCase__							)							)




 def       __A					(		self	:						int							):


  '''simple docstring'''







  UpperCAmelCase_       				=			[
      '''text_encoder/pytorch_model.bin''',
      '''text_encoder/model.safetensors''',
  ]
  UpperCAmelCase_       				=			'''fp16'''
  self.assertTrue(is_safetensors_compatible(lowerCamelCase__		,	variant=lowerCamelCase__							)							)




 def       __A					(		self	:						Tuple							):


  '''simple docstring'''







  UpperCAmelCase_       				=			[
      '''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''',
  ]
  UpperCAmelCase_       				=			'''fp16'''
  self.assertFalse(is_safetensors_compatible(lowerCamelCase__		,	variant=lowerCamelCase__							)							)


from collections.abc import Sequence



def       __lowerCAmelCase      (						A       ,     A = False    ):
	if not arr:
		return 0

	UpperCAmelCase_       				=			0 if allow_empty_subarrays else float("-inf"    )
	UpperCAmelCase_       				=			0.0
	for num in arr:
		UpperCAmelCase_       				=			max(0 if allow_empty_subarrays else num       ,     curr_sum + num    )
		UpperCAmelCase_       				=			max(A       ,     A    )

	return max_sum


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

				testmod()

				_a:    Any 							=			[-2, 1, -3, 4, -1, 2, 1, -5, 4]
				print(F'{max_subarray_sum(nums) = }')