



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


SCREAMING_SNAKE_CASE__       =      logging.get_logger(__name__)

SCREAMING_SNAKE_CASE__       =      {
    "transfo-xl-wt103": "https://huggingface.co/transfo-xl-wt103/resolve/main/config.json",
}


class      __lowerCAmelCase     (		_UpperCAmelCase      ):
					"""simple docstring"""






					A__				:		Union[str, Any]			       =    '''transfo-xl'''
					A__				:		List[Any]			       =    ['''mems''']
					A__				:		List[str]			       =    {
					    '''n_token''': '''vocab_size''',
					    '''hidden_size''': '''d_model''',
					    '''num_attention_heads''': '''n_head''',
					    '''num_hidden_layers''': '''n_layer''',
					}



					def __init__(     self					:       List[str]				,					_snake_case					:       Optional[int]=26_77_35				,					_snake_case					:       int=[2_00_00, 4_00_00, 20_00_00]				,					_snake_case					:       Tuple=10_24				,					_snake_case					:       Optional[Any]=10_24				,					_snake_case					:       Tuple=16				,					_snake_case					:       int=64				,					_snake_case					:       Any=40_96				,					_snake_case					:       Optional[int]=4				,					_snake_case					:       Tuple=False				,					_snake_case					:       List[str]=18				,					_snake_case					:       Union[str, Any]=16_00				,					_snake_case					:       List[Any]=10_00				,					_snake_case					:       Optional[Any]=True				,					_snake_case					:       int=True				,					_snake_case					:       Optional[int]=0				,					_snake_case					:       Dict=-1				,					_snake_case					:       int=True				,					_snake_case					:       List[Any]=0.1				,					_snake_case					:       int=0.0				,					_snake_case					:       Union[str, Any]=True				,					_snake_case					:       Any="normal"				,					_snake_case					:       Tuple=0.01				,					_snake_case					:       int=0.01				,					_snake_case					:       List[Any]=0.02				,					_snake_case					:       Optional[int]=1E-5				,					_snake_case					:       Optional[int]=0				,					**_snake_case					:       Dict				,					):






								"""simple docstring"""


								A__       =    vocab_size
								A__       =    []
								self.cutoffs.extend(A_					)
								if proj_share_all_but_first:
											A__       =    [False] + [True] * len(self.cutoffs					)
								else:
											A__       =    [False] + [False] * len(self.cutoffs					)
								A__       =    d_model
								A__       =    d_embed
								A__       =    d_head
								A__       =    d_inner
								A__       =    div_val
								A__       =    pre_lnorm
								A__       =    n_layer
								A__       =    n_head
								A__       =    mem_len
								A__       =    same_length
								A__       =    attn_type
								A__       =    clamp_len
								A__       =    sample_softmax
								A__       =    adaptive
								A__       =    dropout
								A__       =    dropatt
								A__       =    untie_r
								A__       =    init
								A__       =    init_range
								A__       =    proj_init_std
								A__       =    init_std
								A__       =    layer_norm_epsilon
								super().__init__(eos_token_id=A_				,					**A_					)



					@property
					def     _a							(     self					:       Optional[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					:       Union[str, Any]				,					_snake_case					:       Tuple					):






								"""simple docstring"""


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











import webbrowser
from sys import argv
from urllib.parse import parse_qs, quote

import requests
from bsa import BeautifulSoup
from fake_useragent import UserAgent

if __name__ == "__main__":
							SCREAMING_SNAKE_CASE__       =      '''%20'''.join(argv[1:]) if len(argv) > 1 else quote(str(input('''Search: ''')))

							print('''Googling.....''')

							SCREAMING_SNAKE_CASE__       =      f'https://www.google.com/search?q={query}&num=100'

							SCREAMING_SNAKE_CASE__       =      requests.get(
							    url,
							    headers={'''User-Agent''': str(UserAgent().random)},
							)

							try:
														SCREAMING_SNAKE_CASE__       =      (
														    BeautifulSoup(res.text, '''html.parser''')
														    .find('''div''', attrs={'''class''': '''yuRUbf'''})
														    .find('''a''')
														    .get('''href''')
														)

							except AttributeError:
														SCREAMING_SNAKE_CASE__       =      parse_qs(
														    BeautifulSoup(res.text, '''html.parser''')
														    .find('''div''', attrs={'''class''': '''kCrYT'''})
														    .find('''a''')
														    .get('''href''')
														)['''url'''][0]

							webbrowser.open(link)




