




from cva import destroyAllWindows, imread, imshow, waitKey



def       UpperCAmelCase       (     _snake_case							):
       # getting number of pixels in the image
       lowerCAmelCase   ,     lowerCAmelCase   =		img.shape[0], img.shape[1]

       # converting each pixel's color to its negative
       for i in range(_snake_case							):
              for j in range(_snake_case							):
                     lowerCAmelCase   =		[255, 255, 255] - img[i][j]

       return img


if __name__ == "__main__":
  # read original image
  UpperCAmelCase_						=imread("""image_data/lena.jpg""", 1)

  # convert to its negative
  UpperCAmelCase_						=convert_to_negative(img)

  # show result image
  imshow("""negative of original image""", img)
  waitKey(0)
  destroyAllWindows()









from collections.abc import Sequence



def       UpperCAmelCase       (     _snake_case						, _snake_case = False							):
							if not arr:
														return 0

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

							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) = }''')



