def       A	(    _lowercase						):
						SCREAMING_SNAKE_CASE							:    List[str]							=							generate_pascal_triangle(_lowercase						)
						for row_idx in range(_lowercase						):
												# 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	(    _lowercase						):

						if not isinstance(_lowercase		,  _lowercase						):
												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'''						)

						SCREAMING_SNAKE_CASE							:    List[str]							=							[]
						for current_row_idx in range(_lowercase						):
												SCREAMING_SNAKE_CASE							:    int							=							populate_current_row(_lowercase		,  _lowercase						)
												triangle.append(_lowercase						)
						return triangle
def       A	(    _lowercase		,  _lowercase						):
						SCREAMING_SNAKE_CASE							:    List[str]							=							[-1] * (current_row_idx + 1)
						# first and last elements of current row are equal to 1
						SCREAMING_SNAKE_CASE				,  SCREAMING_SNAKE_CASE							:    Tuple							=							1, 1
						for current_col_idx in range(1		,  _lowercase						):
												calculate_current_element(
												    _lowercase		,  _lowercase		,  _lowercase		,  _lowercase						)
						return current_row
def       A	(    _lowercase		,  _lowercase		,  _lowercase		,  _lowercase		,  ):
						SCREAMING_SNAKE_CASE							:    str							=							triangle[current_row_idx - 1][current_col_idx - 1]
						SCREAMING_SNAKE_CASE							:    Union[str, Any]							=							triangle[current_row_idx - 1][current_col_idx]
						SCREAMING_SNAKE_CASE							:    Union[str, Any]							=							above_to_left_elt + above_to_right_elt
def       A	(    _lowercase						):

						if not isinstance(_lowercase		,  _lowercase						):
												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'''						)

						SCREAMING_SNAKE_CASE							:    int							=							[[1]]

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

						return result
def       A	(    ):
						from collections.abc import Callable
						from timeit import timeit

						def benchmark_a_function(_lowercase		,  _lowercase						) -> None:
												SCREAMING_SNAKE_CASE							:    str							=							f"""{func.__name__}({value})"""
												SCREAMING_SNAKE_CASE							:    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(_lowercase		,  _lowercase						)
												print()


if __name__ == "__main__":
					import doctest

					doctest.testmod()
					benchmark()












"""simple docstring"""
def 					A__				(			UpperCamelCase					,  UpperCamelCase = False       ):

							if not isinstance(UpperCamelCase					,  UpperCamelCase       ):
														A		=  F"Expected string as input, found {type(UpperCamelCase       )}"
														raise ValueError(UpperCamelCase       )
							if not isinstance(UpperCamelCase					,  UpperCamelCase       ):
														A		=  F"Expected boolean as use_pascal parameter, found {type(UpperCamelCase       )}"
														raise ValueError(UpperCamelCase       )

							A		=  input_str.split("_"       )

							A		=  0 if use_pascal else 1

							A		=  words[start_index:]

							A		=  [word[0].upper() + word[1:] for word in words_to_capitalize]

							A		=  "" if use_pascal else words[0]

							return "".join([initial_word, *capitalized_words]       )


if __name__ == "__main__":
		from doctest import testmod

		testmod()


