





'''simple docstring'''






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


__lowerCamelCase						: Any		=   logging.get_logger(__name__)

__lowerCamelCase						: List[Any]		=   {
    '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   (				lowercase_):


  """simple docstring"""







  lowerCAmelCase_					=				"""realm"""


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

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

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

    # Retrieval config
    _UpperCamelCase       			=num_block_records
    _UpperCamelCase       			=searcher_beam_size













'''simple docstring'''






def 					_a   (__SCREAMING_SNAKE_CASE  ,      __SCREAMING_SNAKE_CASE   ):


  """simple docstring"""

  _UpperCamelCase       			=[[] for _ in range(__SCREAMING_SNAKE_CASE   )]
  _UpperCamelCase       			=key - 1

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

  for position, character in enumerate(__SCREAMING_SNAKE_CASE   ):
    _UpperCamelCase       			=position % (lowest * 2)  # puts it in bounds
    _UpperCamelCase       			=min(__SCREAMING_SNAKE_CASE  ,      lowest * 2 - num   )  # creates zigzag pattern
    temp_grid[num].append(__SCREAMING_SNAKE_CASE   )
  _UpperCamelCase       			=[''''''.join(__SCREAMING_SNAKE_CASE   ) for row in temp_grid]
  _UpperCamelCase       			=''''''.join(__SCREAMING_SNAKE_CASE   )

  return output_string


def 					_a   (__SCREAMING_SNAKE_CASE  ,      __SCREAMING_SNAKE_CASE   ):


  """simple docstring"""

  _UpperCamelCase       			=[]
  _UpperCamelCase       			=key - 1

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

  _UpperCamelCase       			=[[] for _ in range(__SCREAMING_SNAKE_CASE   )]  # generates template
  for position in range(len(__SCREAMING_SNAKE_CASE   )   ):
    _UpperCamelCase       			=position % (lowest * 2)  # puts it in bounds
    _UpperCamelCase       			=min(__SCREAMING_SNAKE_CASE  ,      lowest * 2 - num   )  # creates zigzag pattern
    temp_grid[num].append('''*'''   )

  _UpperCamelCase       			=0
  for row in temp_grid:  # fills in the characters
    _UpperCamelCase       			=input_string[counter : counter + len(__SCREAMING_SNAKE_CASE   )]
    grid.append(list(__SCREAMING_SNAKE_CASE   )   )
    counter += len(__SCREAMING_SNAKE_CASE   )

  _UpperCamelCase       			=''''''  # reads as zigzag
  for position in range(len(__SCREAMING_SNAKE_CASE   )   ):
    _UpperCamelCase       			=position % (lowest * 2)  # puts it in bounds
    _UpperCamelCase       			=min(__SCREAMING_SNAKE_CASE  ,      lowest * 2 - num   )  # creates zigzag pattern
    output_string += grid[num][0]
    grid[num].pop(0   )
  return output_string


def 					_a   (__SCREAMING_SNAKE_CASE   ):


  """simple docstring"""

  _UpperCamelCase       			={}
  for key_guess in range(1  ,      len(__SCREAMING_SNAKE_CASE   )   ):  # tries every key
    _UpperCamelCase       			=decrypt(__SCREAMING_SNAKE_CASE  ,      __SCREAMING_SNAKE_CASE   )
  return results


if __name__ == "__main__":
      import doctest

      doctest.testmod()






