

'''simple docstring'''





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


UpperCamelCase_							=					logging.get_logger(__name__)

UpperCamelCase_							=					{
    """google/realm-cc-news-pretrained-embedder""": (
        """https://huggingface.co/google/realm-cc-news-pretrained-embedder/resolve/main/config.json"""
    ),
    """google/realm-cc-news-pretrained-encoder""": (
        """https://huggingface.co/google/realm-cc-news-pretrained-encoder/resolve/main/config.json"""
    ),
    """google/realm-cc-news-pretrained-scorer""": (
        """https://huggingface.co/google/realm-cc-news-pretrained-scorer/resolve/main/config.json"""
    ),
    """google/realm-cc-news-pretrained-openqa""": (
        """https://huggingface.co/google/realm-cc-news-pretrained-openqa/aresolve/main/config.json"""
    ),
    """google/realm-orqa-nq-openqa""": """https://huggingface.co/google/realm-orqa-nq-openqa/resolve/main/config.json""",
    """google/realm-orqa-nq-reader""": """https://huggingface.co/google/realm-orqa-nq-reader/resolve/main/config.json""",
    """google/realm-orqa-wq-openqa""": """https://huggingface.co/google/realm-orqa-wq-openqa/resolve/main/config.json""",
    """google/realm-orqa-wq-reader""": """https://huggingface.co/google/realm-orqa-wq-reader/resolve/main/config.json""",
    # See all REALM models at https://huggingface.co/models?filter=realm
}





class 		__SCREAMING_SNAKE_CASE       ( lowercase__			):
				lowerCamelCase_							=						'realm'







				def __init__(					self    :		List[Any]		,				UpperCAmelCase__    :		Union[str, Any]=30522		,				UpperCAmelCase__    :		Optional[Any]=768		,				UpperCAmelCase__    :		int=128		,				UpperCAmelCase__    :		Dict=12		,				UpperCAmelCase__    :		Optional[int]=12		,				UpperCAmelCase__    :		List[Any]=8		,				UpperCAmelCase__    :		List[Any]=3072		,				UpperCAmelCase__    :		Dict="gelu_new"		,				UpperCAmelCase__    :		List[Any]=0.1		,				UpperCAmelCase__    :		Optional[int]=0.1		,				UpperCAmelCase__    :		int=512		,				UpperCAmelCase__    :		Optional[int]=2		,				UpperCAmelCase__    :		Any=0.02		,				UpperCAmelCase__    :		Union[str, Any]=1E-12		,				UpperCAmelCase__    :		Optional[Any]=256		,				UpperCAmelCase__    :		List[str]=10		,				UpperCAmelCase__    :		Tuple=1E-3		,				UpperCAmelCase__    :		Union[str, Any]=5		,				UpperCAmelCase__    :		Optional[int]=320		,				UpperCAmelCase__    :		Optional[Any]=13353718		,				UpperCAmelCase__    :		List[str]=5000		,				UpperCAmelCase__    :		Any=1		,				UpperCAmelCase__    :		str=0		,				UpperCAmelCase__    :		str=2		,				**UpperCAmelCase__    :		Optional[Any]		,				):
										'''simple docstring'''
										super().__init__(pad_token_id=UpperCAmelCase__		,				bos_token_id=UpperCAmelCase__		,				eos_token_id=UpperCAmelCase__		,				**UpperCAmelCase__      )

										# Common config
										lowercase   :       str								=vocab_size
										lowercase   :       Tuple								=max_position_embeddings
										lowercase   :       str								=hidden_size
										lowercase   :       List[str]								=retriever_proj_size
										lowercase   :       int								=num_hidden_layers
										lowercase   :       List[str]								=num_attention_heads
										lowercase   :       Any								=num_candidates
										lowercase   :       List[str]								=intermediate_size
										lowercase   :       int								=hidden_act
										lowercase   :       str								=hidden_dropout_prob
										lowercase   :       List[Any]								=attention_probs_dropout_prob
										lowercase   :       Optional[Any]								=initializer_range
										lowercase   :       List[str]								=type_vocab_size
										lowercase   :       Union[str, Any]								=layer_norm_eps

										# Reader config
										lowercase   :       Optional[int]								=span_hidden_size
										lowercase   :       Optional[Any]								=max_span_width
										lowercase   :       Dict								=reader_layer_norm_eps
										lowercase   :       Any								=reader_beam_size
										lowercase   :       List[Any]								=reader_seq_len

										# Retrieval config
										lowercase   :       Dict								=num_block_records
										lowercase   :       Any								=searcher_beam_size








'''simple docstring'''





from __future__ import annotations






def 							_lowerCAmelCase (      __magic_name__	:    list[list[int]]	)							->     bool:
						lowercase   :       str								=len(__magic_name__	)
						# We need to create solution object to save path.
						lowercase   :       int								=[[0 for _ in range(__magic_name__	)] for _ in range(__magic_name__	)]
						lowercase   :       List[Any]								=run_maze(__magic_name__      ,   0      ,   0      ,   __magic_name__	)
						if solved:
												print('''\n'''.join(str(__magic_name__	) for row in solutions	)	)
						else:
												print('''No solution exists!'''	)
						return solved






def 							_lowerCAmelCase (      __magic_name__	:    list[list[int]]      ,   __magic_name__	:    int      ,   __magic_name__	:    int      ,   __magic_name__	:    list[list[int]]	)							->     bool:
						lowercase   :       Optional[int]								=len(__magic_name__	)
						# Final check point.
						if i == j == (size - 1):
												lowercase   :       Optional[int]								=1
												return True

						lowercase   :       Optional[int]								=(not i < 0) and (not j < 0)  # Check lower bounds
						lowercase   :       Tuple								=(i < size) and (j < size)  # Check upper bounds

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

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

																		lowercase   :       str								=0
																		return False
						return False


if __name__ == "__main__":
							import doctest

							doctest.testmod()





