



'''simple docstring'''


import argparse
import math
import traceback

import dateutil.parser as date_parser
import requests







def      SCREAMING_SNAKE_CASE				(				lowercase_    :      Any						):
						lowercase        =							{}

						lowercase        =							job["""started_at"""]
						lowercase        =							job["""completed_at"""]

						lowercase        =							date_parser.parse(lowercase_						)
						lowercase        =							date_parser.parse(lowercase_						)

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

						lowercase        =							start
						lowercase        =							end
						lowercase        =							duration_in_min

						return job_info







def      SCREAMING_SNAKE_CASE				(				lowercase_    :      Tuple ,  lowercase_    :      List[Any]=None						):
						lowercase        =							None
						if token is not None:
												lowercase        =							{"""Accept""": """application/vnd.github+json""", """Authorization""": F"""Bearer {token}"""}

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

						try:
												job_time.update({job["""name"""]: extract_time_from_single_job(lowercase_						) for job in result["""jobs"""]}						)
												lowercase        =							math.ceil((result["""total_count"""] - 100) / 100						)

												for i in range(lowercase_						):
																		lowercase        =							requests.get(url + F"""&page={i + 2}""" ,  headers=lowercase_						).json()
																		job_time.update({job["""name"""]: extract_time_from_single_job(lowercase_						) 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__":
						lowercase_      :				int   					=    argparse.ArgumentParser()
						# Required parameters
						parser.add_argument('''--workflow_run_id''', type=str, required=True, help='''A GitHub Actions workflow run id.''')
						lowercase_      :				Union[str, Any]   					=    parser.parse_args()

						lowercase_      :				str   					=    get_job_time(args.workflow_run_id)
						lowercase_      :				List[str]   					=    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'''


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


lowercase_      :				Optional[Any]   					=    logging.get_logger(__name__)

lowercase_      :				int   					=    {
    '''bigcode/gpt_bigcode-santacoder''': '''https://huggingface.co/bigcode/gpt_bigcode-santacoder/resolve/main/config.json''',
}




class      __UpperCamelCase       (_UpperCAmelCase			):
	__A			  =					'''gpt_bigcode'''
	__A			  =					['''past_key_values''']
	__A			  =					{
	    '''hidden_size''': '''n_embd''',
	    '''max_position_embeddings''': '''n_positions''',
	    '''num_attention_heads''': '''n_head''',
	    '''num_hidden_layers''': '''n_layer''',
	}







	def __init__(    self ,				_lowerCAmelCase=5_0257 ,				_lowerCAmelCase=1024 ,				_lowerCAmelCase=768 ,				_lowerCAmelCase=12 ,				_lowerCAmelCase=12 ,				_lowerCAmelCase=None ,				_lowerCAmelCase="gelu_pytorch_tanh" ,				_lowerCAmelCase=0.1 ,				_lowerCAmelCase=0.1 ,				_lowerCAmelCase=0.1 ,				_lowerCAmelCase=1E-5 ,				_lowerCAmelCase=0.02 ,				_lowerCAmelCase=True ,				_lowerCAmelCase=True ,				_lowerCAmelCase=5_0256 ,				_lowerCAmelCase=5_0256 ,				_lowerCAmelCase=True ,				_lowerCAmelCase=True ,				_lowerCAmelCase=True ,				**_lowerCAmelCase ,				)    ->    Optional[int]:
							'''simple docstring'''






							lowercase        =							vocab_size
							lowercase        =							n_positions
							lowercase        =							n_embd
							lowercase        =							n_layer
							lowercase        =							n_head
							lowercase        =							n_inner
							lowercase        =							activation_function
							lowercase        =							resid_pdrop
							lowercase        =							embd_pdrop
							lowercase        =							attn_pdrop
							lowercase        =							layer_norm_epsilon
							lowercase        =							initializer_range
							lowercase        =							scale_attn_weights
							lowercase        =							use_cache
							lowercase        =							attention_softmax_in_fpaa
							lowercase        =							scale_attention_softmax_in_fpaa
							lowercase        =							multi_query

							lowercase        =							bos_token_id
							lowercase        =							eos_token_id

							super().__init__(bos_token_id=_lowerCAmelCase ,				eos_token_id=_lowerCAmelCase ,				**_lowerCAmelCase						)


