




'''simple docstring'''







import warnings

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


A									=logging.get_logger(__name__)

A									={
    'xlnet-base-cased': 'https://huggingface.co/xlnet-base-cased/resolve/main/config.json',
    'xlnet-large-cased': 'https://huggingface.co/xlnet-large-cased/resolve/main/config.json',
}


class     _a						(			__a				):
       __a       :  Dict            =      """xlnet"""
       __a       :  Dict            =      ["""mems"""]
       __a       :  str            =      {
           """n_token""": """vocab_size""",  # Backward compatibility
           """hidden_size""": """d_model""",
           """num_attention_heads""": """n_head""",
           """num_hidden_layers""": """n_layer""",
       }
       def __init__(			self		:			Dict     ,       lowercase		:			Any=32_000     ,       lowercase		:			int=1_024     ,       lowercase		:			Optional[int]=24     ,       lowercase		:			Optional[int]=16     ,       lowercase		:			Union[str, Any]=4_096     ,       lowercase		:			int="gelu"     ,       lowercase		:			Tuple=True     ,       lowercase		:			List[str]="bi"     ,       lowercase		:			List[Any]=0.02     ,       lowercase		:			List[Any]=1E-12     ,       lowercase		:			Tuple=0.1     ,       lowercase		:			List[Any]=512     ,       lowercase		:			Union[str, Any]=None     ,       lowercase		:			Dict=True     ,       lowercase		:			List[Any]=False     ,       lowercase		:			Union[str, Any]=False     ,       lowercase		:			Any=-1     ,       lowercase		:			Dict=False     ,       lowercase		:			Optional[int]="last"     ,       lowercase		:			List[str]=True     ,       lowercase		:			Optional[int]="tanh"     ,       lowercase		:			List[str]=0.1     ,       lowercase		:			Union[str, Any]=5     ,       lowercase		:			List[Any]=5     ,       lowercase		:			int=5     ,       lowercase		:			Any=1     ,       lowercase		:			int=2     ,       **lowercase		:			Optional[Any]     ,       ):



           '''simple docstring'''

           UpperCAmelCase     =	vocab_size
           UpperCAmelCase     =	d_model
           UpperCAmelCase     =	n_layer
           UpperCAmelCase     =	n_head
           if d_model % n_head != 0:
               raise ValueError(f"'d_model % n_head' ({d_model % n_head}) should be equal to 0"       )
           if "d_head" in kwargs:
               if kwargs["d_head"] != d_model // n_head:
                   raise ValueError(
                       f"`d_head` ({kwargs['d_head']}) should be equal to `d_model // n_head` ({d_model // n_head})"       )
           UpperCAmelCase     =	d_model // n_head
           UpperCAmelCase     =	ff_activation
           UpperCAmelCase     =	d_inner
           UpperCAmelCase     =	untie_r
           UpperCAmelCase     =	attn_type

           UpperCAmelCase     =	initializer_range
           UpperCAmelCase     =	layer_norm_eps

           UpperCAmelCase     =	dropout
           UpperCAmelCase     =	mem_len
           UpperCAmelCase     =	reuse_len
           UpperCAmelCase     =	bi_data
           UpperCAmelCase     =	clamp_len
           UpperCAmelCase     =	same_length

           UpperCAmelCase     =	summary_type
           UpperCAmelCase     =	summary_use_proj
           UpperCAmelCase     =	summary_activation
           UpperCAmelCase     =	summary_last_dropout
           UpperCAmelCase     =	start_n_top
           UpperCAmelCase     =	end_n_top

           UpperCAmelCase     =	bos_token_id
           UpperCAmelCase     =	pad_token_id
           UpperCAmelCase     =	eos_token_id

           if "use_cache" in kwargs:
               warnings.warn(
                   '''The `use_cache` argument is deprecated and will be removed in a future version, use `use_mems_eval`'''
                   ''' instead.'''     ,       lowercase     ,       )
               UpperCAmelCase     =	kwargs['''use_cache''']

           UpperCAmelCase     =	use_mems_eval
           UpperCAmelCase     =	use_mems_train
           super().__init__(pad_token_id=lowercase     ,       bos_token_id=lowercase     ,       eos_token_id=lowercase     ,       **lowercase       )
       @property
       def 					A   (			self		:			int       ):



           '''simple docstring'''

           logger.info(f"The model {self.model_type} is one of the few models that has no sequence length limit."       )
           return -1







       @max_position_embeddings.setter
       def 					A   (			self		:			Tuple     ,       lowercase		:			List[Any]       ):



           '''simple docstring'''

           raise NotImplementedError(
               f"The model {self.model_type} is one of the few models that has no sequence length limit."       )










'''simple docstring'''







import argparse
import math
import traceback

import dateutil.parser as date_parser
import requests





def 		snake_case_							(_a			:							List[str]  ):
    UpperCAmelCase     =	{}

    UpperCAmelCase     =	job['''started_at''']
    UpperCAmelCase     =	job['''completed_at''']

    UpperCAmelCase     =	date_parser.parse(_a  )
    UpperCAmelCase     =	date_parser.parse(_a  )

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

    UpperCAmelCase     =	start
    UpperCAmelCase     =	end
    UpperCAmelCase     =	duration_in_min

    return job_info





def 		snake_case_							(_a			:							str					,     _a			:							List[str]=None  ):
    UpperCAmelCase     =	None
    if token is not None:
        UpperCAmelCase     =	{'''Accept''': '''application/vnd.github+json''', '''Authorization''': F"Bearer {token}"}

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

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

        for i in range(_a  ):
            UpperCAmelCase     =	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									=argparse.ArgumentParser()
   # Required parameters
   parser.add_argument('--workflow_run_id', type=str, required=True, help='A GitHub Actions workflow run id.')
   A									=parser.parse_args()

   A									=get_job_time(args.workflow_run_id)
   A									=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"]}""")




