
from cva import destroyAllWindows, imread, imshow, waitKey





def 			lowerCamelCase_ (				lowerCamelCase__    ):
				# 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(lowerCamelCase__    ):
								for j in range(lowerCamelCase__    ):
												lowerCamelCase_						=			[2_5_5, 2_5_5, 2_5_5] - img[i][j]

				return img


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

			# convert to its negative
			__A				=convert_to_negative(img)

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




from collections import defaultdict

from graphs.minimum_spanning_tree_prims import prisms_algorithm as mst





def 			lowerCamelCase_ (				):
				lowerCamelCase_	,    lowerCamelCase_						=			9, 1_4  # noqa: F841
				lowerCamelCase_						=			[
				    [0, 1, 4],
				    [0, 7, 8],
				    [1, 2, 8],
				    [7, 8, 7],
				    [7, 6, 1],
				    [2, 8, 2],
				    [8, 6, 6],
				    [2, 3, 7],
				    [2, 5, 4],
				    [6, 5, 2],
				    [3, 5, 1_4],
				    [3, 4, 9],
				    [5, 4, 1_0],
				    [1, 7, 1_1],
				]

				lowerCamelCase_						=			defaultdict(lowerCamelCase__    )
				for nodea, nodea, cost in edges:
								adjancency[nodea].append([nodea, cost]    )
								adjancency[nodea].append([nodea, cost]    )

				lowerCamelCase_						=			mst(lowerCamelCase__    )

				lowerCamelCase_						=			[
				    [7, 6, 1],
				    [2, 8, 2],
				    [6, 5, 2],
				    [0, 1, 4],
				    [2, 5, 4],
				    [2, 3, 7],
				    [0, 7, 8],
				    [3, 4, 9],
				]

				for answer in expected:
								lowerCamelCase_						=			tuple(answer[:2]    )
								lowerCamelCase_						=			tuple(edge[::-1]    )
								assert edge in result or reverse in result


