

'''simple docstring'''
from ...configuration_utils import PretrainedConfig
from ...utils import logging


lowerCamelCase :      List[Any]					 =     logging.get_logger(__name__)

lowerCamelCase :      List[str]					 =     {
    "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 							A__    (       A__  ):
  A__		 =				'realm'





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





       '''simple docstring'''






       super().__init__(pad_token_id=_a							,					bos_token_id=_a							,					eos_token_id=_a							,					**_a )

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

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

       # Retrieval config
       _SCREAMING_SNAKE_CASE							    =num_block_records
       _SCREAMING_SNAKE_CASE							    =searcher_beam_size



'''simple docstring'''
class 							A__    :





  def __init__(		self      :	Union[str, Any]							,					_a      :	int )	->    None:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE							    =size
       _SCREAMING_SNAKE_CASE							    =[0] * size
       _SCREAMING_SNAKE_CASE							    =[0] * size





  @staticmethod
  def 						A  (		_a      :	int )	->    int:





       '''simple docstring'''






       return index | (index + 1)





  @staticmethod
  def 						A  (		_a      :	int )	->    int:





       '''simple docstring'''






       return (index & (index + 1)) - 1





  def 						A  (		self      :	Tuple							,					_a      :	int							,					_a      :	int )	->    None:





       '''simple docstring'''






       _SCREAMING_SNAKE_CASE							    =value
       while index < self.size:
            _SCREAMING_SNAKE_CASE							    =self.get_prev(_a ) + 1
            if current_left_border == index:
                 _SCREAMING_SNAKE_CASE							    =value
            else:
                 _SCREAMING_SNAKE_CASE							    =max(_a							,					_a							,					_a )
            _SCREAMING_SNAKE_CASE							    =self.get_next(_a )





  def 						A  (		self      :	int							,					_a      :	int							,					_a      :	int )	->    int:





       '''simple docstring'''






       right -= 1  # Because of right is exclusive
       _SCREAMING_SNAKE_CASE							    =0
       while left <= right:
            _SCREAMING_SNAKE_CASE							    =self.get_prev(_a )
            if left <= current_left:
                 _SCREAMING_SNAKE_CASE							    =max(_a							,					self.tree[right] )
                 _SCREAMING_SNAKE_CASE							    =current_left
            else:
                 _SCREAMING_SNAKE_CASE							    =max(_a							,					self.arr[right] )
                 right -= 1
       return result


if __name__ == "__main__":
     import doctest

     doctest.testmod()
