


'''simple docstring'''
import argparse
import math
import traceback

import dateutil.parser as date_parser
import requests


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



					'''simple docstring'''






					UpperCamelCase__   :Dict												= {}

					UpperCamelCase__   :Tuple												= job['''started_at''']
					UpperCamelCase__   :Union[str, Any]												= job['''completed_at''']

					UpperCamelCase__   :Dict												= date_parser.parse(__a   )
					UpperCamelCase__   :int												= date_parser.parse(__a   )

					UpperCamelCase__   :Any												= round((end_datetime - start_datetime).total_seconds() / 6_0.0   )

					UpperCamelCase__   :Optional[Any]												= start
					UpperCamelCase__   :Tuple												= end
					UpperCamelCase__   :Optional[Any]												= duration_in_min

					return job_info


def 			a      (			__a ,					__a=None   )  ->	Optional[Any]:



					'''simple docstring'''






					UpperCamelCase__   :Tuple												= None
					if token is not None:
										UpperCamelCase__   :List[str]												= {'''Accept''': '''application/vnd.github+json''', '''Authorization''': f'''Bearer {token}'''}

					UpperCamelCase__   :Tuple												= f'''https://api.github.com/repos/huggingface/transformers/actions/runs/{workflow_run_id}/jobs?per_page=100'''
					UpperCamelCase__   :Dict												= requests.get(__a ,					headers=__a   ).json()
					UpperCamelCase__   :Any												= {}

					try:
										job_time.update({job['''name''']: extract_time_from_single_job(__a   ) for job in result['''jobs''']}   )
										UpperCamelCase__   :str												= math.ceil((result['''total_count'''] - 100) / 100   )

										for i in range(__a   ):
															UpperCamelCase__   :Any												= requests.get(url + f'''&page={i + 2}''' ,					headers=__a   ).json()
															job_time.update({job['''name''']: extract_time_from_single_job(__a   ) for job in result['''jobs''']}   )

										return job_time
					except Exception:
										print(f'''Unknown error, could not fetch links:\n{traceback.format_exc()}'''   )

					return {}


if __name__ == "__main__":
		__snake_case							      =     argparse.ArgumentParser()
		# Required parameters
		parser.add_argument('''--workflow_run_id''', type=str, required=True, help='''A GitHub Actions workflow run id.''')
		__snake_case							      =     parser.parse_args()

		__snake_case							      =     get_job_time(args.workflow_run_id)
		__snake_case							      =     dict(sorted(job_time.items(), key=lambda item: item[1]["duration"], reverse=True))

		for k, v in job_time.items():
				print(F"""{k}: {v['duration']}""")



'''simple docstring'''
def 			a      (			__a   )  ->	"list[int]":



					'''simple docstring'''






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

					UpperCamelCase__   :Optional[Any]												= [0] * (upper_limit + 1)

					# Base case: C(0) = C(1) = 1
					UpperCamelCase__   :int												= 1
					if upper_limit > 0:
										UpperCamelCase__   :int												= 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(__a   ):
															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:
						__snake_case							      =     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()