"""simple docstring"""






def 						a_		(      lowerCamelCase ):
				if upper_limit < 0:
								raise ValueError('Limit for the Catalan sequence must be ≥ 0' )

				UpperCAmelCase__    =							[0] * (upper_limit + 1)

				# Base case: C(0) = C(1) = 1
				UpperCAmelCase__    =							1
				if upper_limit > 0:
								UpperCAmelCase__    =							1

				# Recurrence relation: C(i) = sum(C(j).C(i-j-1)), from j = 0 to i
				for i in range(2      ,    upper_limit + 1 ):
								for j in range(lowerCamelCase ):
												catalan_list[i] += catalan_list[j] * catalan_list[i - j - 1]

				return catalan_list


if __name__ == "__main__":
						print('\n********* Catalan Numbers Using Dynamic Programming ************\n')
						print('\n*** Enter -1 at any time to quit ***')
						print('\nEnter the upper limit (≥ 0) for the Catalan number sequence: ', end='')
						try:
												while True:
																		lowerCAmelCase__						:						Any		  =			int(input().strip())
																		if N < 0:
																								print('\n********* Goodbye!! ************')
																								break
																		else:
																								print(F"""The Catalan numbers from 0 through {N} are:""")
																								print(catalan_numbers(N))
																								print('Try another upper limit for the sequence: ', end='')
						except (NameError, ValueError):
												print('\n********* Invalid input, goodbye! ************\n')

						import doctest

						doctest.testmod()


"""simple docstring"""






from ...configuration_utils import PretrainedConfig
from ...utils import logging


lowerCAmelCase__						:						Any		  =			logging.get_logger(__name__)

lowerCAmelCase__						:						str		  =			{'ctrl': 'https://huggingface.co/ctrl/resolve/main/config.json'}
class        snake_case (				__UpperCAmelCase       ):




					"""simple docstring"""

					snake_case__       					=				"ctrl"
					snake_case__       					=				["past_key_values"]
					snake_case__       					=				{
					    "max_position_embeddings": "n_positions",
					    "hidden_size": "n_embd",
					    "num_attention_heads": "n_head",
					    "num_hidden_layers": "n_layer",
					}







					def __init__(       self     :			Any					,lowerCamelCase__     :			str=246_534					,lowerCamelCase__     :			List[str]=256					,lowerCamelCase__     :			Optional[int]=1_280					,lowerCamelCase__     :			Any=8_192					,lowerCamelCase__     :			int=48					,lowerCamelCase__     :			Optional[Any]=16					,lowerCamelCase__     :			Union[str, Any]=0.1					,lowerCamelCase__     :			Dict=0.1					,lowerCamelCase__     :			List[str]=1e-6					,lowerCamelCase__     :			List[str]=0.0_2					,lowerCamelCase__     :			Tuple=True					,**lowerCamelCase__     :			Optional[Any]					,):
									UpperCAmelCase__    =							vocab_size
									UpperCAmelCase__    =							n_positions
									UpperCAmelCase__    =							n_embd
									UpperCAmelCase__    =							n_layer
									UpperCAmelCase__    =							n_head
									UpperCAmelCase__    =							dff
									UpperCAmelCase__    =							resid_pdrop
									UpperCAmelCase__    =							embd_pdrop
									UpperCAmelCase__    =							layer_norm_epsilon
									UpperCAmelCase__    =							initializer_range

									UpperCAmelCase__    =							use_cache

									super().__init__(**lowerCamelCase__    )



