

class   __lowercase    :




			"""simple docstring"""







			def __init__(			self  :					Optional[Any]       ,						lowerCAmelCase__  :					int       ,						lowerCAmelCase__  :					Optional[Any]=None       ,						lowerCAmelCase__  :					int=None):
									SCREAMING_SNAKE_CASE_:			Union[str, Any]  		=	data
									SCREAMING_SNAKE_CASE_:			str  		=	previous
									SCREAMING_SNAKE_CASE_:			Dict  		=	next_node




			def __str__(			self  :					Union[str, Any]):
									return F"{self.data}"




			def 	_SCREAMING_SNAKE_CASE      (			self  :					Tuple):
									return self.data




			def 	_SCREAMING_SNAKE_CASE      (			self  :					str):
									return self.next




			def 	_SCREAMING_SNAKE_CASE      (			self  :					Dict):
									return self.previous







class   __lowercase    :




			"""simple docstring"""







			def __init__(			self  :					int       ,						lowerCAmelCase__  :					List[Any]):
									SCREAMING_SNAKE_CASE_:			Any  		=	head




			def __iter__(			self  :					Optional[int]):
									return self




			def 	_SCREAMING_SNAKE_CASE      (			self  :					Optional[Any]):
									if not self.current:
															raise StopIteration
									else:
															SCREAMING_SNAKE_CASE_:			Tuple  		=	self.current.get_data()
															SCREAMING_SNAKE_CASE_:			Tuple  		=	self.current.get_next()
															return value







class   __lowercase    :




			"""simple docstring"""







			def __init__(			self  :					List[Any]):
									SCREAMING_SNAKE_CASE_:			Tuple  		=	None  # First node in list
									SCREAMING_SNAKE_CASE_:			Dict  		=	None  # Last node in list




			def __str__(			self  :					List[str]):
									SCREAMING_SNAKE_CASE_:			List[str]  		=	self.head
									SCREAMING_SNAKE_CASE_:			Tuple  		=	[]
									while current is not None:
															nodes.append(current.get_data())
															SCREAMING_SNAKE_CASE_:			List[str]  		=	current.get_next()
									return " ".join(str(__snake_case) for node in nodes)




			def __contains__(			self  :					Optional[Any]       ,						lowerCAmelCase__  :					int):
									SCREAMING_SNAKE_CASE_:			Dict  		=	self.head
									while current:
															if current.get_data() == value:
																					return True
															SCREAMING_SNAKE_CASE_:			Any  		=	current.get_next()
									return False




			def __iter__(			self  :					Dict):
									return LinkedListIterator(self.head)




			def 	_SCREAMING_SNAKE_CASE      (			self  :					Tuple):
									if self.head:
															return self.head.get_data()
									return None




			def 	_SCREAMING_SNAKE_CASE      (			self  :					Dict):
									if self.tail:
															return self.tail.get_data()
									return None




			def 	_SCREAMING_SNAKE_CASE      (			self  :					List[Any]       ,						lowerCAmelCase__  :					Node):
									if self.head is None:
															SCREAMING_SNAKE_CASE_:			Tuple  		=	node
															SCREAMING_SNAKE_CASE_:			int  		=	node
									else:
															self.insert_before_node(self.head       ,						__snake_case)




			def 	_SCREAMING_SNAKE_CASE      (			self  :					int       ,						lowerCAmelCase__  :					Node):
									if self.head is None:
															self.set_head(__snake_case)
									else:
															self.insert_after_node(self.tail       ,						__snake_case)




			def 	_SCREAMING_SNAKE_CASE      (			self  :					str       ,						lowerCAmelCase__  :					int):
									SCREAMING_SNAKE_CASE_:			List[Any]  		=	Node(__snake_case)
									if self.head is None:
															self.set_head(__snake_case)
									else:
															self.set_tail(__snake_case)




			def 	_SCREAMING_SNAKE_CASE      (			self  :					List[Any]       ,						lowerCAmelCase__  :					Node       ,						lowerCAmelCase__  :					Node):
									SCREAMING_SNAKE_CASE_:			Union[str, Any]  		=	node
									SCREAMING_SNAKE_CASE_:			List[Any]  		=	node.previous

									if node.get_previous() is None:
															SCREAMING_SNAKE_CASE_:			str  		=	node_to_insert
									else:
															SCREAMING_SNAKE_CASE_:			Optional[int]  		=	node_to_insert

									SCREAMING_SNAKE_CASE_:			Any  		=	node_to_insert




			def 	_SCREAMING_SNAKE_CASE      (			self  :					Optional[int]       ,						lowerCAmelCase__  :					Node       ,						lowerCAmelCase__  :					Node):
									SCREAMING_SNAKE_CASE_:			Union[str, Any]  		=	node
									SCREAMING_SNAKE_CASE_:			Dict  		=	node.next

									if node.get_next() is None:
															SCREAMING_SNAKE_CASE_:			int  		=	node_to_insert
									else:
															SCREAMING_SNAKE_CASE_:			List[str]  		=	node_to_insert

									SCREAMING_SNAKE_CASE_:			Union[str, Any]  		=	node_to_insert




			def 	_SCREAMING_SNAKE_CASE      (			self  :					int       ,						lowerCAmelCase__  :					int       ,						lowerCAmelCase__  :					int):
									SCREAMING_SNAKE_CASE_:			int  		=	1
									SCREAMING_SNAKE_CASE_:			str  		=	Node(__snake_case)
									SCREAMING_SNAKE_CASE_:			Optional[int]  		=	self.head
									while node:
															if current_position == position:
																					self.insert_before_node(__snake_case       ,						__snake_case)
																					return
															current_position += 1
															SCREAMING_SNAKE_CASE_:			Union[str, Any]  		=	node.next
									self.insert_after_node(self.tail       ,						__snake_case)




			def 	_SCREAMING_SNAKE_CASE      (			self  :					str       ,						lowerCAmelCase__  :					int):
									SCREAMING_SNAKE_CASE_:			int  		=	self.head
									while node:
															if node.get_data() == item:
																					return node
															SCREAMING_SNAKE_CASE_:			List[Any]  		=	node.get_next()
									raise Exception("Node not found")




			def 	_SCREAMING_SNAKE_CASE      (			self  :					Any       ,						lowerCAmelCase__  :					Dict):
									if (node := self.get_node(__snake_case)) is not None:
															if node == self.head:
																					SCREAMING_SNAKE_CASE_:			Any  		=	self.head.get_next()

															if node == self.tail:
																					SCREAMING_SNAKE_CASE_:			int  		=	self.tail.get_previous()

															self.remove_node_pointers(__snake_case)




			@staticmethod
			def 	_SCREAMING_SNAKE_CASE      (			lowerCAmelCase__  :					Node):
									if node.get_next():
															SCREAMING_SNAKE_CASE_:			int  		=	node.previous

									if node.get_previous():
															SCREAMING_SNAKE_CASE_:			List[Any]  		=	node.next

									SCREAMING_SNAKE_CASE_:			List[str]  		=	None
									SCREAMING_SNAKE_CASE_:			Optional[int]  		=	None




			def 	_SCREAMING_SNAKE_CASE      (			self  :					List[Any]):
									return self.head is None







def       A_				(   ):
						pass


if __name__ == "__main__":
						import doctest

						doctest.testmod()









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


lowerCAmelCase							:  Optional[int]            =						logging.get_logger(__name__)

lowerCAmelCase							:  int            =						{
    """google/fnet-base""": """https://huggingface.co/google/fnet-base/resolve/main/config.json""",
    """google/fnet-large""": """https://huggingface.co/google/fnet-large/resolve/main/config.json"""
    # See all FNet models at https://huggingface.co/models?filter=fnet
}



class   __lowercase    (			UpperCAmelCase_     ):




			"""simple docstring"""







			_UpperCAmelCase       :							int      							=					'''fnet'''



			def __init__(			self  :					Optional[Any]       ,						lowerCAmelCase__  :					List[str]=3_2000       ,						lowerCAmelCase__  :					Union[str, Any]=768       ,						lowerCAmelCase__  :					Optional[Any]=12       ,						lowerCAmelCase__  :					Tuple=3072       ,						lowerCAmelCase__  :					Any="gelu_new"       ,						lowerCAmelCase__  :					Union[str, Any]=0.1       ,						lowerCAmelCase__  :					Optional[Any]=512       ,						lowerCAmelCase__  :					int=4       ,						lowerCAmelCase__  :					List[Any]=0.02       ,						lowerCAmelCase__  :					Union[str, Any]=1E-12       ,						lowerCAmelCase__  :					Optional[int]=False       ,						lowerCAmelCase__  :					Any=512       ,						lowerCAmelCase__  :					Optional[int]=3       ,						lowerCAmelCase__  :					int=1       ,						lowerCAmelCase__  :					List[Any]=2       ,						**lowerCAmelCase__  :					Optional[int]       ,						):
									super().__init__(pad_token_id=lowerCAmelCase__       ,						bos_token_id=lowerCAmelCase__       ,						eos_token_id=lowerCAmelCase__       ,						**lowerCAmelCase__)

									SCREAMING_SNAKE_CASE_:			str  		=	vocab_size
									SCREAMING_SNAKE_CASE_:			Optional[Any]  		=	max_position_embeddings
									SCREAMING_SNAKE_CASE_:			Tuple  		=	hidden_size
									SCREAMING_SNAKE_CASE_:			Union[str, Any]  		=	num_hidden_layers
									SCREAMING_SNAKE_CASE_:			Optional[int]  		=	intermediate_size
									SCREAMING_SNAKE_CASE_:			Union[str, Any]  		=	hidden_act
									SCREAMING_SNAKE_CASE_:			Any  		=	hidden_dropout_prob
									SCREAMING_SNAKE_CASE_:			int  		=	initializer_range
									SCREAMING_SNAKE_CASE_:			Optional[int]  		=	type_vocab_size
									SCREAMING_SNAKE_CASE_:			int  		=	layer_norm_eps
									SCREAMING_SNAKE_CASE_:			Union[str, Any]  		=	use_tpu_fourier_optimizations
									SCREAMING_SNAKE_CASE_:			int  		=	tpu_short_seq_length






