




'''simple docstring'''

from __future__ import annotations



def 							UpperCamelCase__			(			a__			,      a__      ):


						'''simple docstring'''






						print(F'''Vertex\tShortest Distance from vertex {src}'''      )
						for i, d in enumerate(_lowerCAmelCase      ):
												print(F'''{i}\t\t{d}'''      )



def 							UpperCamelCase__			(			a__			,      a__			,      a__      ):


						'''simple docstring'''






						for j in range(_lowerCAmelCase      ):
												_lowerCAmelCase						,				_lowerCAmelCase						,				_lowerCAmelCase										=(graph[j][k] for k in ['src', 'dst', 'weight'])
												if distance[u] != float('inf'      ) and distance[u] + w < distance[v]:
																		return True
						return False



def 							UpperCamelCase__			(			a__			,      a__			,      a__			,      a__      ):


						'''simple docstring'''






						_lowerCAmelCase										=[float('inf'      )] * vertex_count
						_lowerCAmelCase										=0.0

						for _ in range(vertex_count - 1      ):
												for j in range(_lowerCAmelCase      ):
																		_lowerCAmelCase						,				_lowerCAmelCase						,				_lowerCAmelCase										=(graph[j][k] for k in ['src', 'dst', 'weight'])

																		if distance[u] != float('inf'      ) and distance[u] + w < distance[v]:
																								_lowerCAmelCase										=distance[u] + w

						_lowerCAmelCase										=check_negative_cycle(_lowerCAmelCase			,      _lowerCAmelCase			,      _lowerCAmelCase      )
						if negative_cycle_exists:
												raise Exception('Negative cycle found'      )

						return distance


if __name__ == "__main__":
							import doctest

							doctest.testmod()

							lowercase_     		= int(input('''Enter number of vertices: ''').strip())
							lowercase_     		= int(input('''Enter number of edges: ''').strip())

							lowercase_     		= [{} for _ in range(E)]

							for i in range(E):
														print('''Edge ''', i + 1)
														lowercase_		,			lowercase_		,			lowercase_     		= (
														    int(x)
														    for x in input('''Enter source, destination, weight: ''').strip().split(''' ''')
														)
														lowercase_     		= {'''src''': src, '''dst''': dest, '''weight''': weight}

							lowercase_     		= int(input('''\nEnter shortest path source:''').strip())
							lowercase_     		= bellman_ford(graph, V, E, source)
							print_distance(shortest_distance, 0)






'''simple docstring'''

from PIL import Image



def 							UpperCamelCase__			(			a__			,      a__      ):


						'''simple docstring'''






						def brightness(a__      ) -> float:
												return 1_2_8 + level + (c - 1_2_8)

						if not -255.0 <= level <= 255.0:
												raise ValueError('level must be between -255.0 (black) and 255.0 (white)'      )
						return img.point(a__      )


if __name__ == "__main__":
							# Load image
							with Image.open('''image_data/lena.jpg''') as img:
														# Change brightness to 100
														lowercase_     		= change_brightness(img, 100)
														brigt_img.save('''image_data/lena_brightness.png''', format='''png''')





