"""simple docstring"""


from collections import deque







def 					UpperCAmelCase    (		UpperCAmelCase					)				->      int:
     snake_case_					       =					len(UpperCAmelCase					)
     snake_case_					       =					deque()
     snake_case_					       =					[False for _ in range(UpperCAmelCase					)]
     snake_case_					       =					[-1 for _ in range(UpperCAmelCase					)]
     snake_case_					       =					index_of[:]

     def strong_connect(UpperCAmelCase						,					UpperCAmelCase						,					UpperCAmelCase					):
          snake_case_					       =					index  # the number when this node is seen
          snake_case_					       =					index  # lowest rank node reachable from here
          index += 1
          stack.append(UpperCAmelCase					)
          snake_case_					       =					True

          for w in g[v]:
               if index_of[w] == -1:
                    snake_case_					       =					strong_connect(UpperCAmelCase						,					UpperCAmelCase						,					UpperCAmelCase					)
                    snake_case_					       =					(
                        lowlink_of[w] if lowlink_of[w] < lowlink_of[v] else lowlink_of[v]
                    )
               elif on_stack[w]:
                    snake_case_					       =					(
                        lowlink_of[w] if lowlink_of[w] < lowlink_of[v] else lowlink_of[v]
                    )

          if lowlink_of[v] == index_of[v]:
               snake_case_					       =					[]
               snake_case_					       =					stack.pop()
               snake_case_					       =					False
               component.append(UpperCAmelCase					)
               while w != v:
                    snake_case_					       =					stack.pop()
                    snake_case_					       =					False
                    component.append(UpperCAmelCase					)
               components.append(UpperCAmelCase					)
          return index

     snake_case_					       =					[]
     for v in range(UpperCAmelCase					):
          if index_of[v] == -1:
               strong_connect(UpperCAmelCase						,					0						,					UpperCAmelCase					)

     return components







def 					UpperCAmelCase    (		UpperCAmelCase						,					UpperCAmelCase					)				->      Optional[int]:
     snake_case_					       =					[[] for _ in range(UpperCAmelCase					)]
     for u, v in edges:
          g[u].append(UpperCAmelCase					)
     return g


if __name__ == "__main__":
    # Test
    __UpperCamelCase									=			7
    __UpperCamelCase									=			[0, 0, 1, 2, 3, 3, 4, 4, 6]
    __UpperCamelCase									=			[1, 3, 2, 0, 1, 4, 5, 6, 5]
    __UpperCamelCase									=			[(u, v) for u, v in zip(source, target)]
    __UpperCamelCase									=			create_graph(n_vertices, edges)

    assert [[5], [6], [4], [3, 2, 1, 0]] == tarjan(g)





'''simple docstring'''
from PIL import Image


def 			a      (			__a ,					__a   )  ->	Image:



					'''simple docstring'''






					def brightness(__a   ) -> float:
										return 128 + level + (c - 128)

					if not -2_5_5.0 <= level <= 2_5_5.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
				__snake_case							      =     change_brightness(img, 100)
				brigt_img.save('''image_data/lena_brightness.png''', format='''png''')