


'''simple docstring'''
def 			a      (			__a   )  ->	None:



					'''simple docstring'''






					UpperCamelCase__   :Optional[int]												= generate_pascal_triangle(__a   )
					for row_idx in range(__a   ):
										# Print left spaces
										for _ in range(num_rows - row_idx - 1   ):
															print(end=''' '''   )
										# Print row values
										for col_idx in range(row_idx + 1   ):
															if col_idx != row_idx:
																				print(triangle[row_idx][col_idx] ,					end=''' '''   )
															else:
																				print(triangle[row_idx][col_idx] ,					end=''''''   )
										print()


def 			a      (			__a   )  ->	list[list[int]]:



					'''simple docstring'''






					if not isinstance(__a ,					__a   ):
										raise TypeError('''The input value of \'num_rows\' should be \'int\''''   )

					if num_rows == 0:
										return []
					elif num_rows < 0:
										raise ValueError(
										    '''The input value of \'num_rows\' should be greater than or equal to 0'''   )

					UpperCamelCase__   :list[list[int]]												= []
					for current_row_idx in range(__a   ):
										UpperCamelCase__   :List[Any]												= populate_current_row(__a ,					__a   )
										triangle.append(__a   )
					return triangle


def 			a      (			__a ,					__a   )  ->	list[int]:



					'''simple docstring'''






					UpperCamelCase__   :int												= [-1] * (current_row_idx + 1)
					# first and last elements of current row are equal to 1
					UpperCamelCase__					,				UpperCamelCase__   :Dict												= 1, 1
					for current_col_idx in range(1 ,					__a   ):
										calculate_current_element(
										    __a ,					__a ,					__a ,					__a   )
					return current_row


def 			a      (			__a ,					__a ,					__a ,					__a ,					)  ->	None:



					'''simple docstring'''






					UpperCamelCase__   :Any												= triangle[current_row_idx - 1][current_col_idx - 1]
					UpperCamelCase__   :List[Any]												= triangle[current_row_idx - 1][current_col_idx]
					UpperCamelCase__   :List[Any]												= above_to_left_elt + above_to_right_elt


def 			a      (			__a   )  ->	list[list[int]]:



					'''simple docstring'''






					if not isinstance(__a ,					__a   ):
										raise TypeError('''The input value of \'num_rows\' should be \'int\''''   )

					if num_rows == 0:
										return []
					elif num_rows < 0:
										raise ValueError(
										    '''The input value of \'num_rows\' should be greater than or equal to 0'''   )

					UpperCamelCase__   :list[list[int]]												= [[1]]

					for row_index in range(1 ,					__a   ):
										UpperCamelCase__   :Any												= [0] + result[-1] + [0]
										UpperCamelCase__   :Optional[int]												= row_index + 1
										# Calculate the number of distinct elements in a row
										UpperCamelCase__   :Any												= sum(divmod(__a ,					2   )   )
										UpperCamelCase__   :Optional[int]												= [
										    temp_row[i - 1] + temp_row[i] for i in range(1 ,					distinct_elements + 1   )
										]
										UpperCamelCase__   :Optional[int]												= row_first_half[: (row_index + 1) // 2]
										row_second_half.reverse()
										UpperCamelCase__   :Dict												= row_first_half + row_second_half
										result.append(__a   )

					return result


def 			a      (			)  ->	None:



					'''simple docstring'''






					from collections.abc import Callable
					from timeit import timeit

					def benchmark_a_function(__a ,					__a   ) -> None:
										UpperCamelCase__   :List[str]												= f'''{func.__name__}({value})'''
										UpperCamelCase__   :List[str]												= timeit(f'''__main__.{call}''' ,					setup='''import __main__'''   )
										# print(f"{call:38} = {func(value)} -- {timing:.4f} seconds")
										print(f'''{call:38} -- {timing:.4f} seconds'''   )

					for value in range(15   ):  # (1, 7, 14):
										for func in (generate_pascal_triangle, generate_pascal_triangle_optimized):
															benchmark_a_function(__a ,					__a   )
										print()


if __name__ == "__main__":
		import doctest

		doctest.testmod()
		benchmark()



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