






from __future__ import annotations

from typing import Any

class 				lowerCAmelCase_	(		__snake_case			):
				pass




class 				lowerCAmelCase_	:


				def __init__(					self ,						_lowerCAmelCase      ):
											_lowercase							:   Any 							=   data
											_lowercase							:   Node | None 							=   None


				def __iter__(					self      ):
											_lowercase							:   Union[str, Any] 							=   self
											_lowercase							:   Tuple 							=   []
											while node:
																		if node in visited:
																									raise ContainsLoopError
																		visited.append(_lowerCAmelCase      )
																		yield node.data
																		_lowercase							:   Optional[int] 							=   node.next_node


				@property
				def 						__a					(					self      ):
											try:
																		list(self      )
																		return False
											except ContainsLoopError:
																		return True


if __name__ == "__main__":
							UpperCamelCase								=		Node(1)
							UpperCamelCase								=		Node(2)
							UpperCamelCase								=		Node(3)
							UpperCamelCase								=		Node(4)
							print(root_node.has_loop)  # False
							UpperCamelCase								=		root_node.next_node
							print(root_node.has_loop)  # True

							UpperCamelCase								=		Node(5)
							UpperCamelCase								=		Node(6)
							UpperCamelCase								=		Node(5)
							UpperCamelCase								=		Node(6)
							print(root_node.has_loop)  # False

							UpperCamelCase								=		Node(1)
							print(root_node.has_loop)  # False










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


_lowerCamelCase      :						str							=  logging.get_logger(__name__)

_lowerCamelCase      :						List[str]							=  {"""openai-gpt""": """https://huggingface.co/openai-gpt/resolve/main/config.json"""}


class 							UpperCamelCase_       (					UpperCAmelCase__	):

    '''simple docstring'''






    UpperCAmelCase__				    = '''openai-gpt'''
    UpperCAmelCase__				    = {
        '''max_position_embeddings''': '''n_positions''',
        '''hidden_size''': '''n_embd''',
        '''num_attention_heads''': '''n_head''',
        '''num_hidden_layers''': '''n_layer''',
    }


    def __init__(     self :      Union[str, Any]   ,					UpperCAmelCase__ :      Dict=40_478   ,					UpperCAmelCase__ :      str=512   ,					UpperCAmelCase__ :      Union[str, Any]=768   ,					UpperCAmelCase__ :      Optional[Any]=12   ,					UpperCAmelCase__ :      Any=12   ,					UpperCAmelCase__ :      Optional[Any]="gelu"   ,					UpperCAmelCase__ :      Any=0.1   ,					UpperCAmelCase__ :      List[str]=0.1   ,					UpperCAmelCase__ :      Tuple=0.1   ,					UpperCAmelCase__ :      List[str]=1e-5   ,					UpperCAmelCase__ :      int=0.02   ,					UpperCAmelCase__ :      Any="cls_index"   ,					UpperCAmelCase__ :      Optional[Any]=True   ,					UpperCAmelCase__ :      List[Any]=None   ,					UpperCAmelCase__ :      List[Any]=True   ,					UpperCAmelCase__ :      Optional[Any]=0.1   ,					**UpperCAmelCase__ :      Dict   ,					)		->Any:





           '''simple docstring'''

           A__ 					=       vocab_size
           A__ 					=       n_positions
           A__ 					=       n_embd
           A__ 					=       n_layer
           A__ 					=       n_head
           A__ 					=       afn
           A__ 					=       resid_pdrop
           A__ 					=       embd_pdrop
           A__ 					=       attn_pdrop
           A__ 					=       layer_norm_epsilon
           A__ 					=       initializer_range
           A__ 					=       summary_type
           A__ 					=       summary_use_proj
           A__ 					=       summary_activation
           A__ 					=       summary_first_dropout
           A__ 					=       summary_proj_to_labels
           super().__init__(**UpperCAmelCase__)


