

class 			_SCREAMING_SNAKE_CASE      :







						def __init__(			self     ,						_SCREAMING_SNAKE_CASE							)->							str:
													lowerCamelCase_								=data
													lowerCamelCase_								=None
													lowerCamelCase_								=None







						def __str__(			self							)->							Union[str, Any]:
													return f'{self.data}'


class 			_SCREAMING_SNAKE_CASE      :







						def __init__(			self							)->							Optional[Any]:
													lowerCamelCase_								=None
													lowerCamelCase_								=None







						def __iter__(			self							)->							Any:
													lowerCamelCase_								=self.head
													while node:
																				yield node.data
																				lowerCamelCase_								=node.next







						def __str__(			self							)->							List[Any]:
													return "->".join([str(_SCREAMING_SNAKE_CASE							) for item in self]							)







						def __len__(			self							)->							Dict:
													return sum(1 for _ in self							)







						def        _snake_case				(			self     ,						_SCREAMING_SNAKE_CASE							)->							str:
													self.insert_at_nth(0     ,						_SCREAMING_SNAKE_CASE							)







						def        _snake_case				(			self     ,						_SCREAMING_SNAKE_CASE							)->							Any:
													self.insert_at_nth(len(self							)     ,						_SCREAMING_SNAKE_CASE							)







						def        _snake_case				(			self     ,						_SCREAMING_SNAKE_CASE     ,						_SCREAMING_SNAKE_CASE							)->							Optional[int]:
													lowerCamelCase_								=len(self							)

													if not 0 <= index <= length:
																				raise IndexError("""list index out of range"""							)
													lowerCamelCase_								=Node(_SCREAMING_SNAKE_CASE							)
													if self.head is None:
																				lowerCamelCase_								=lowerCamelCase_								=new_node
													elif index == 0:
																				lowerCamelCase_								=new_node
																				lowerCamelCase_								=self.head
																				lowerCamelCase_								=new_node
													elif index == length:
																				lowerCamelCase_								=new_node
																				lowerCamelCase_								=self.tail
																				lowerCamelCase_								=new_node
													else:
																				lowerCamelCase_								=self.head
																				for _ in range(0     ,						_SCREAMING_SNAKE_CASE							):
																											lowerCamelCase_								=temp.next
																				lowerCamelCase_								=new_node
																				lowerCamelCase_								=temp.previous
																				lowerCamelCase_								=temp
																				lowerCamelCase_								=new_node







						def        _snake_case				(			self							)->							List[Any]:
													return self.delete_at_nth(0							)







						def        _snake_case				(			self							)->							List[str]:
													return self.delete_at_nth(len(self							) - 1							)







						def        _snake_case				(			self     ,						_SCREAMING_SNAKE_CASE							)->							Optional[int]:
													lowerCamelCase_								=len(self							)

													if not 0 <= index <= length - 1:
																				raise IndexError("""list index out of range"""							)
													lowerCamelCase_								=self.head  # default first node
													if length == 1:
																				lowerCamelCase_								=lowerCamelCase_								=None
													elif index == 0:
																				lowerCamelCase_								=self.head.next
																				lowerCamelCase_								=None
													elif index == length - 1:
																				lowerCamelCase_								=self.tail
																				lowerCamelCase_								=self.tail.previous
																				lowerCamelCase_								=None
													else:
																				lowerCamelCase_								=self.head
																				for _ in range(0     ,						_SCREAMING_SNAKE_CASE							):
																											lowerCamelCase_								=temp.next
																				lowerCamelCase_								=temp
																				lowerCamelCase_								=temp.previous
																				lowerCamelCase_								=temp.next
													return delete_node.data







						def        _snake_case				(			self     ,						_SCREAMING_SNAKE_CASE							)->							str:
													lowerCamelCase_								=self.head

													while current.data != data:  # Find the position to delete
																				if current.next:
																											lowerCamelCase_								=current.next
																				else:  # We have reached the end an no value matches
																											raise ValueError("""No data matching given value"""							)

													if current == self.head:
																				self.delete_head()

													elif current == self.tail:
																				self.delete_tail()

													else:  # Before: 1 <--> 2(current) <--> 3
																				lowerCamelCase_								=current.next  # 1 --> 3
																				lowerCamelCase_								=current.previous  # 1 <--> 3
													return data







						def        _snake_case				(			self							)->							int:
													return len(self							) == 0




def        __UpperCamelCase     (      )				->None:



							"""simple docstring"""
							lowerCamelCase_								=DoublyLinkedList()
							assert linked_list.is_empty() is True
							assert str(_A		) == ""

							try:
														linked_list.delete_head()
														raise AssertionError  # This should not happen.
							except IndexError:
														assert True  # This should happen.

							try:
														linked_list.delete_tail()
														raise AssertionError  # This should not happen.
							except IndexError:
														assert True  # This should happen.

							for i in range(10		):
														assert len(_A		) == i
														linked_list.insert_at_nth(_A      ,  i + 1		)
							assert str(_A		) == "->".join(str(_A		) for i in range(1      ,  11		)		)

							linked_list.insert_at_head(0		)
							linked_list.insert_at_tail(11		)
							assert str(_A		) == "->".join(str(_A		) for i in range(0      ,  12		)		)

							assert linked_list.delete_head() == 0
							assert linked_list.delete_at_nth(9		) == 10
							assert linked_list.delete_tail() == 11
							assert len(_A		) == 9
							assert str(_A		) == "->".join(str(_A		) for i in range(1      ,  10		)		)


if __name__ == "__main__":
	from doctest import testmod

	testmod()



from collections import OrderedDict
from typing import Mapping

from ...configuration_utils import PretrainedConfig
from ...onnx import OnnxConfig
from ...utils import logging


__A	:   List[Any]	=					logging.get_logger(__name__)

__A	:   Tuple	=					{
    'google/electra-small-generator': 'https://huggingface.co/google/electra-small-generator/resolve/main/config.json',
    'google/electra-base-generator': 'https://huggingface.co/google/electra-base-generator/resolve/main/config.json',
    'google/electra-large-generator': 'https://huggingface.co/google/electra-large-generator/resolve/main/config.json',
    'google/electra-small-discriminator': (
        'https://huggingface.co/google/electra-small-discriminator/resolve/main/config.json'
    ),
    'google/electra-base-discriminator': (
        'https://huggingface.co/google/electra-base-discriminator/resolve/main/config.json'
    ),
    'google/electra-large-discriminator': (
        'https://huggingface.co/google/electra-large-discriminator/resolve/main/config.json'
    ),
}


class 			_SCREAMING_SNAKE_CASE      (  lowerCAmelCase__):
						_UpperCamelCase:Tuple	=		"electra"







						def __init__(			self     ,						_SCREAMING_SNAKE_CASE=3_0522     ,						_SCREAMING_SNAKE_CASE=128     ,						_SCREAMING_SNAKE_CASE=256     ,						_SCREAMING_SNAKE_CASE=12     ,						_SCREAMING_SNAKE_CASE=4     ,						_SCREAMING_SNAKE_CASE=1024     ,						_SCREAMING_SNAKE_CASE="gelu"     ,						_SCREAMING_SNAKE_CASE=0.1     ,						_SCREAMING_SNAKE_CASE=0.1     ,						_SCREAMING_SNAKE_CASE=512     ,						_SCREAMING_SNAKE_CASE=2     ,						_SCREAMING_SNAKE_CASE=0.0_2     ,						_SCREAMING_SNAKE_CASE=1E-12     ,						_SCREAMING_SNAKE_CASE="first"     ,						_SCREAMING_SNAKE_CASE=True     ,						_SCREAMING_SNAKE_CASE="gelu"     ,						_SCREAMING_SNAKE_CASE=0.1     ,						_SCREAMING_SNAKE_CASE=0     ,						_SCREAMING_SNAKE_CASE="absolute"     ,						_SCREAMING_SNAKE_CASE=True     ,						_SCREAMING_SNAKE_CASE=None     ,						**_SCREAMING_SNAKE_CASE     ,						)->							Optional[int]:
													super().__init__(pad_token_id=_SCREAMING_SNAKE_CASE     ,						**_SCREAMING_SNAKE_CASE							)

													lowerCamelCase_								=vocab_size
													lowerCamelCase_								=embedding_size
													lowerCamelCase_								=hidden_size
													lowerCamelCase_								=num_hidden_layers
													lowerCamelCase_								=num_attention_heads
													lowerCamelCase_								=intermediate_size
													lowerCamelCase_								=hidden_act
													lowerCamelCase_								=hidden_dropout_prob
													lowerCamelCase_								=attention_probs_dropout_prob
													lowerCamelCase_								=max_position_embeddings
													lowerCamelCase_								=type_vocab_size
													lowerCamelCase_								=initializer_range
													lowerCamelCase_								=layer_norm_eps

													lowerCamelCase_								=summary_type
													lowerCamelCase_								=summary_use_proj
													lowerCamelCase_								=summary_activation
													lowerCamelCase_								=summary_last_dropout
													lowerCamelCase_								=position_embedding_type
													lowerCamelCase_								=use_cache
													lowerCamelCase_								=classifier_dropout


class 			_SCREAMING_SNAKE_CASE      (  lowerCAmelCase__):







						@property
						def        _snake_case				(			self							)->							Mapping[str, Mapping[int, str]]:
													if self.task == "multiple-choice":
																				lowerCamelCase_								={0: """batch""", 1: """choice""", 2: """sequence"""}
													else:
																				lowerCamelCase_								={0: """batch""", 1: """sequence"""}
													return OrderedDict(
													    [
													        ("""input_ids""", dynamic_axis),
													        ("""attention_mask""", dynamic_axis),
													        ("""token_type_ids""", dynamic_axis),
													    ]							)
