





from collections.abc import Generator
from math import sin







def        __lowerCamelCase (							__a       :bytes   )		->    bytes:






		"""simple docstring"""

		if len(__a   ) != 3_2:
				raise ValueError("""Input must be of length 32"""   )

		A__  				=       b""""""
		for i in [3, 2, 1, 0]:
				little_endian += string_aa[8 * i : 8 * i + 8]
		return little_endian







def        __lowerCamelCase (							__a       :int   )		->    bytes:






		"""simple docstring"""

		if i < 0:
				raise ValueError("""Input must be non-negative"""   )

		A__  				=       format(__a   ,					"""08x"""   )[-8:]
		A__  				=       b""""""
		for i in [3, 2, 1, 0]:
				little_endian_hex += hex_rep[2 * i : 2 * i + 2].encode("""utf-8"""   )
		return little_endian_hex







def        __lowerCamelCase (							__a       :bytes   )		->    bytes:






		"""simple docstring"""

		A__  				=       b""""""
		for char in message:
				bit_string += format(__a   ,					"""08b"""   ).encode("""utf-8"""   )
		A__  				=       format(len(__a   )   ,					"""064b"""   ).encode("""utf-8"""   )

		# Pad bit_string to a multiple of 512 chars
		bit_string += b"1"
		while len(__a   ) % 5_1_2 != 4_4_8:
				bit_string += b"0"
		bit_string += to_little_endian(start_len[3_2:]   ) + to_little_endian(start_len[:3_2]   )

		return bit_string







def        __lowerCamelCase (							__a       :bytes   )		->    Generator[list[int], None, None]:






		"""simple docstring"""

		if len(__a   ) % 5_1_2 != 0:
				raise ValueError("""Input must have length that's a multiple of 512"""   )

		for pos in range(0   ,					len(__a   )   ,					5_1_2   ):
				A__  				=       bit_string[pos : pos + 5_1_2]
				A__  				=       []
				for i in range(0   ,					5_1_2   ,					3_2   ):
						block_words.append(int(to_little_endian(block[i : i + 3_2]   )   ,					2   )   )
				yield block_words







def        __lowerCamelCase (							__a       :int   )		->    int:






		"""simple docstring"""

		if i < 0:
				raise ValueError("""Input must be non-negative"""   )

		A__  				=       format(__a   ,					"""032b"""   )
		A__  				=       """"""
		for c in i_str:
				new_str += "1" if c == "0" else "0"
		return int(__a   ,					2   )







def        __lowerCamelCase (							__a       :int   ,					__a       :int   )		->    int:






		"""simple docstring"""

		return (a + b) % 2**3_2







def        __lowerCamelCase (							__a       :int   ,					__a       :int   )		->    int:






		"""simple docstring"""

		if i < 0:
				raise ValueError("""Input must be non-negative"""   )
		if shift < 0:
				raise ValueError("""Shift must be non-negative"""   )
		return ((i << shift) ^ (i >> (3_2 - shift))) % 2**3_2







def        __lowerCamelCase (							__a       :bytes   )		->    bytes:






		"""simple docstring"""

		A__  				=       preprocess(__a   )

		A__  				=       [int(2**3_2 * abs(sin(i + 1   )   )   ) for i in range(6_4   )]

		# Starting states
		A__  				=       0X6_7_4_5_2_3_0_1
		A__  				=       0XE_F_C_D_A_B_8_9
		A__  				=       0X9_8_B_A_D_C_F_E
		A__  				=       0X1_0_3_2_5_4_7_6

		A__  				=       [
		    7,
		    1_2,
		    1_7,
		    2_2,
		    7,
		    1_2,
		    1_7,
		    2_2,
		    7,
		    1_2,
		    1_7,
		    2_2,
		    7,
		    1_2,
		    1_7,
		    2_2,
		    5,
		    9,
		    1_4,
		    2_0,
		    5,
		    9,
		    1_4,
		    2_0,
		    5,
		    9,
		    1_4,
		    2_0,
		    5,
		    9,
		    1_4,
		    2_0,
		    4,
		    1_1,
		    1_6,
		    2_3,
		    4,
		    1_1,
		    1_6,
		    2_3,
		    4,
		    1_1,
		    1_6,
		    2_3,
		    4,
		    1_1,
		    1_6,
		    2_3,
		    6,
		    1_0,
		    1_5,
		    2_1,
		    6,
		    1_0,
		    1_5,
		    2_1,
		    6,
		    1_0,
		    1_5,
		    2_1,
		    6,
		    1_0,
		    1_5,
		    2_1,
		]

		# Process bit string in chunks, each with 16 32-char words
		for block_words in get_block_words(__a   ):
				A__  				=       aa
				A__  				=       ba
				A__  				=       ca
				A__  				=       da

				# Hash current chunk
				for i in range(6_4   ):
						if i <= 1_5:
								# f = (b & c) | (not_32(b) & d)     # Alternate definition for f
								A__  				=       d ^ (b & (c ^ d))
								A__  				=       i
						elif i <= 3_1:
								# f = (d & b) | (not_32(d) & c)     # Alternate definition for f
								A__  				=       c ^ (d & (b ^ c))
								A__  				=       (5 * i + 1) % 1_6
						elif i <= 4_7:
								A__  				=       b ^ c ^ d
								A__  				=       (3 * i + 5) % 1_6
						else:
								A__  				=       c ^ (b | not_aa(__a   ))
								A__  				=       (7 * i) % 1_6
						A__  				=       (f + a + added_consts[i] + block_words[g]) % 2**3_2
						A__  				=       d
						A__  				=       c
						A__  				=       b
						A__  				=       sum_aa(__a   ,					left_rotate_aa(__a   ,					shift_amounts[i]   )   )

				# Add hashed chunk to running total
				A__  				=       sum_aa(__a   ,					__a   )
				A__  				=       sum_aa(__a   ,					__a   )
				A__  				=       sum_aa(__a   ,					__a   )
				A__  				=       sum_aa(__a   ,					__a   )

		A__  				=       reformat_hex(__a   ) + reformat_hex(__a   ) + reformat_hex(__a   ) + reformat_hex(__a   )
		return digest


if __name__ == "__main__":
					import doctest

					doctest.testmod()










import argparse
import math
import traceback

import dateutil.parser as date_parser
import requests







def        __lowerCamelCase (							__a       :str   )		->    Optional[int]:






		"""simple docstring"""

		A__  				=       {}

		A__  				=       job["""started_at"""]
		A__  				=       job["""completed_at"""]

		A__  				=       date_parser.parse(__a   )
		A__  				=       date_parser.parse(__a   )

		A__  				=       round((end_datetime - start_datetime).total_seconds() / 60.0   )

		A__  				=       start
		A__  				=       end
		A__  				=       duration_in_min

		return job_info







def        __lowerCamelCase (							__a       :Optional[Any]   ,					__a       :List[str]=None   )		->    List[Any]:






		"""simple docstring"""

		A__  				=       None
		if token is not None:
				A__  				=       {"""Accept""": """application/vnd.github+json""", """Authorization""": F'Bearer {token}'}

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

		try:
				job_time.update({job["""name"""]: extract_time_from_single_job(__a   ) for job in result["""jobs"""]}   )
				A__  				=       math.ceil((result["""total_count"""] - 1_0_0) / 1_0_0   )

				for i in range(__a   ):
						A__  				=       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__":
					A   : Optional[Any]			=				argparse.ArgumentParser()
					# Required parameters
					parser.add_argument('''--workflow_run_id''', type=str, required=True, help='''A GitHub Actions workflow run id.''')
					A   : Dict			=				parser.parse_args()

					A   : List[Any]			=				get_job_time(args.workflow_run_id)
					A   : int			=				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"]}''')



