

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


lowerCAmelCase_       	=	logging.get_logger(__name__)

lowerCAmelCase_       	=	{
    '''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 	snake_case_   (		__A					):







			'''simple docstring'''

			SCREAMING_SNAKE_CASE     :   Dict									=				"fnet"







			def __init__(     self :				List[Any]							,   _UpperCamelCase :				Tuple=3_2_0_0_0							,   _UpperCamelCase :				Optional[Any]=7_6_8							,   _UpperCamelCase :				Union[str, Any]=1_2							,   _UpperCamelCase :				str=3_0_7_2							,   _UpperCamelCase :				Optional[int]="gelu_new"							,   _UpperCamelCase :				Optional[int]=0.1							,   _UpperCamelCase :				Union[str, Any]=5_1_2							,   _UpperCamelCase :				Tuple=4							,   _UpperCamelCase :				Tuple=0.02							,   _UpperCamelCase :				Tuple=1e-12							,   _UpperCamelCase :				List[str]=False							,   _UpperCamelCase :				Union[str, Any]=5_1_2							,   _UpperCamelCase :				Any=3							,   _UpperCamelCase :				str=1							,   _UpperCamelCase :				List[Any]=2							,   **_UpperCamelCase :				List[str]							,   )      ->Union[str, Any]:
									super().__init__(pad_token_id=_UpperCamelCase							,   bos_token_id=_UpperCamelCase							,   eos_token_id=_UpperCamelCase							,   **_UpperCamelCase							)

									snake_case_   =	vocab_size
									snake_case_   =	max_position_embeddings
									snake_case_   =	hidden_size
									snake_case_   =	num_hidden_layers
									snake_case_   =	intermediate_size
									snake_case_   =	hidden_act
									snake_case_   =	hidden_dropout_prob
									snake_case_   =	initializer_range
									snake_case_   =	type_vocab_size
									snake_case_   =	layer_norm_eps
									snake_case_   =	use_tpu_fourier_optimizations
									snake_case_   =	tpu_short_seq_length


from __future__ import annotations


def   __SCREAMING_SNAKE_CASE					(SCREAMING_SNAKE_CASE__       ):
						snake_case_   =	len(SCREAMING_SNAKE_CASE__       )
						# We need to create solution object to save path.
						snake_case_   =	[[0 for _ in range(SCREAMING_SNAKE_CASE__       )] for _ in range(SCREAMING_SNAKE_CASE__       )]
						snake_case_   =	run_maze(SCREAMING_SNAKE_CASE__  ,		0  ,		0  ,		SCREAMING_SNAKE_CASE__       )
						if solved:
												print('''\n'''.join(str(SCREAMING_SNAKE_CASE__       ) for row in solutions       )       )
						else:
												print('''No solution exists!'''       )
						return solved


def   __SCREAMING_SNAKE_CASE					(SCREAMING_SNAKE_CASE__  ,		SCREAMING_SNAKE_CASE__  ,		SCREAMING_SNAKE_CASE__  ,		SCREAMING_SNAKE_CASE__       ):
						snake_case_   =	len(SCREAMING_SNAKE_CASE__       )
						# Final check point.
						if i == j == (size - 1):
												snake_case_   =	1
												return True

						snake_case_   =	(not i < 0) and (not j < 0)  # Check lower bounds
						snake_case_   =	(i < size) and (j < size)  # Check upper bounds

						if lower_flag and upper_flag:
												# check for already visited and block points.
												snake_case_   =	(not solutions[i][j]) and (not maze[i][j])
												if block_flag:
																		# check visited
																		snake_case_   =	1

																		# check for directions
																		if (
																		    run_maze(SCREAMING_SNAKE_CASE__  ,		i + 1  ,		SCREAMING_SNAKE_CASE__  ,		SCREAMING_SNAKE_CASE__       )
																		    or run_maze(SCREAMING_SNAKE_CASE__  ,		SCREAMING_SNAKE_CASE__  ,		j + 1  ,		SCREAMING_SNAKE_CASE__       )
																		    or run_maze(SCREAMING_SNAKE_CASE__  ,		i - 1  ,		SCREAMING_SNAKE_CASE__  ,		SCREAMING_SNAKE_CASE__       )
																		    or run_maze(SCREAMING_SNAKE_CASE__  ,		SCREAMING_SNAKE_CASE__  ,		j - 1  ,		SCREAMING_SNAKE_CASE__       )
																		):
																								return True

																		snake_case_   =	0
																		return False
						return False


if __name__ == "__main__":
					import doctest

					doctest.testmod()