



"""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       UpperCamelCase__			(   _lowerCAmelCase      ):

			"""simple docstring"""


			A__	:					List[Any]							  =     "realm"


			def __init__(      self						,	SCREAMING_SNAKE_CASE__=30522						,	SCREAMING_SNAKE_CASE__=768						,	SCREAMING_SNAKE_CASE__=128						,	SCREAMING_SNAKE_CASE__=12						,	SCREAMING_SNAKE_CASE__=12						,	SCREAMING_SNAKE_CASE__=8						,	SCREAMING_SNAKE_CASE__=3072						,	SCREAMING_SNAKE_CASE__="gelu_new"						,	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__=256						,	SCREAMING_SNAKE_CASE__=10						,	SCREAMING_SNAKE_CASE__=1e-3						,	SCREAMING_SNAKE_CASE__=5						,	SCREAMING_SNAKE_CASE__=320						,	SCREAMING_SNAKE_CASE__=13353718						,	SCREAMING_SNAKE_CASE__=5000						,	SCREAMING_SNAKE_CASE__=1						,	SCREAMING_SNAKE_CASE__=0						,	SCREAMING_SNAKE_CASE__=2						,	**SCREAMING_SNAKE_CASE__						,	)      ->	Any:
				super().__init__(pad_token_id=SCREAMING_SNAKE_CASE__						,	bos_token_id=SCREAMING_SNAKE_CASE__						,	eos_token_id=SCREAMING_SNAKE_CASE__						,	**SCREAMING_SNAKE_CASE__		)

				# Common config
				A__											=					vocab_size
				A__											=					max_position_embeddings
				A__											=					hidden_size
				A__											=					retriever_proj_size
				A__											=					num_hidden_layers
				A__											=					num_attention_heads
				A__											=					num_candidates
				A__											=					intermediate_size
				A__											=					hidden_act
				A__											=					hidden_dropout_prob
				A__											=					attention_probs_dropout_prob
				A__											=					initializer_range
				A__											=					type_vocab_size
				A__											=					layer_norm_eps

				# Reader config
				A__											=					span_hidden_size
				A__											=					max_span_width
				A__											=					reader_layer_norm_eps
				A__											=					reader_beam_size
				A__											=					reader_seq_len

				# Retrieval config
				A__											=					num_block_records
				A__											=					searcher_beam_size





def 		snake_case__	(		lowercase							,				lowercase					):
   lowerCAmelCase_:							list[list[str]]       =	[[] for _ in range(lowercase					)]
   lowerCAmelCase_:							Optional[Any]       =	key - 1

   if key <= 0:
      raise ValueError("Height of grid can't be 0 or negative"					)
   if key == 1 or len(lowercase					) <= key:
      return input_string

   for position, character in enumerate(lowercase					):
      lowerCAmelCase_:							Optional[Any]       =	position % (lowest * 2)  # puts it in bounds
      lowerCAmelCase_:							Any       =	min(lowercase							,				lowest * 2 - num					)  # creates zigzag pattern
      temp_grid[num].append(lowercase					)
   lowerCAmelCase_:							Optional[int]       =	["".join(lowercase					) for row in temp_grid]
   lowerCAmelCase_:							int       =	"".join(lowercase					)

   return output_string
def 		snake_case__	(		lowercase							,				lowercase					):
   lowerCAmelCase_:							Tuple       =	[]
   lowerCAmelCase_:							str       =	key - 1

   if key <= 0:
      raise ValueError("Height of grid can't be 0 or negative"					)
   if key == 1:
      return input_string

   lowerCAmelCase_:							list[list[str]]       =	[[] for _ in range(lowercase					)]  # generates template
   for position in range(len(lowercase					)					):
      lowerCAmelCase_:							List[str]       =	position % (lowest * 2)  # puts it in bounds
      lowerCAmelCase_:							Optional[int]       =	min(lowercase							,				lowest * 2 - num					)  # creates zigzag pattern
      temp_grid[num].append("*"					)

   lowerCAmelCase_:							Optional[Any]       =	0
   for row in temp_grid:  # fills in the characters
      lowerCAmelCase_:							Tuple       =	input_string[counter : counter + len(lowercase					)]
      grid.append(list(lowercase					)					)
      counter += len(lowercase					)

   lowerCAmelCase_:							int       =	""  # reads as zigzag
   for position in range(len(lowercase					)					):
      lowerCAmelCase_:							str       =	position % (lowest * 2)  # puts it in bounds
      lowerCAmelCase_:							Optional[int]       =	min(lowercase							,				lowest * 2 - num					)  # creates zigzag pattern
      output_string += grid[num][0]
      grid[num].pop(0					)
   return output_string
def 		snake_case__	(		lowercase					):
   lowerCAmelCase_:							Dict       =	{}
   for key_guess in range(1							,				len(lowercase					)					):  # tries every key
      lowerCAmelCase_:							int       =	decrypt(lowercase							,				lowercase					)
   return results


if __name__ == "__main__":
 import doctest

 doctest.testmod()