


"""simple docstring"""





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


snake_case__		:     Tuple    				=				logging.get_logger(__name__)

snake_case__		:     Optional[int]    				=				{
    '''facebook/vit-mae-base''': '''https://huggingface.co/facebook/vit-mae-base/resolve/main/config.json''',
    # See all ViT MAE models at https://huggingface.co/models?filter=vit-mae
}



class 		snake_case_(       a__			):
     __UpperCamelCase  =					'''vit_mae'''






     def __init__(	self  :					Tuple					,				UpperCamelCase_  :					List[Any]=7_6_8					,				UpperCamelCase_  :					List[str]=1_2					,				UpperCamelCase_  :					Tuple=1_2					,				UpperCamelCase_  :					List[Any]=3_0_7_2					,				UpperCamelCase_  :					List[str]="gelu"					,				UpperCamelCase_  :					List[str]=0.0					,				UpperCamelCase_  :					int=0.0					,				UpperCamelCase_  :					str=0.02					,				UpperCamelCase_  :					Tuple=1E-12					,				UpperCamelCase_  :					Optional[int]=2_2_4					,				UpperCamelCase_  :					Any=1_6					,				UpperCamelCase_  :					str=3					,				UpperCamelCase_  :					Dict=True					,				UpperCamelCase_  :					List[str]=1_6					,				UpperCamelCase_  :					str=5_1_2					,				UpperCamelCase_  :					Union[str, Any]=8					,				UpperCamelCase_  :					Dict=2_0_4_8					,				UpperCamelCase_  :					Optional[int]=0.75					,				UpperCamelCase_  :					Tuple=False					,				**UpperCamelCase_  :					Any					,				):
           super().__init__(**UpperCamelCase_				)

           lowerCAmelCase					:	int       =   hidden_size
           lowerCAmelCase					:	Union[str, Any]       =   num_hidden_layers
           lowerCAmelCase					:	str       =   num_attention_heads
           lowerCAmelCase					:	Union[str, Any]       =   intermediate_size
           lowerCAmelCase					:	int       =   hidden_act
           lowerCAmelCase					:	Dict       =   hidden_dropout_prob
           lowerCAmelCase					:	Any       =   attention_probs_dropout_prob
           lowerCAmelCase					:	int       =   initializer_range
           lowerCAmelCase					:	Any       =   layer_norm_eps
           lowerCAmelCase					:	Union[str, Any]       =   image_size
           lowerCAmelCase					:	int       =   patch_size
           lowerCAmelCase					:	str       =   num_channels
           lowerCAmelCase					:	List[Any]       =   qkv_bias
           lowerCAmelCase					:	Optional[Any]       =   decoder_num_attention_heads
           lowerCAmelCase					:	int       =   decoder_hidden_size
           lowerCAmelCase					:	Any       =   decoder_num_hidden_layers
           lowerCAmelCase					:	Any       =   decoder_intermediate_size
           lowerCAmelCase					:	List[str]       =   mask_ratio
           lowerCAmelCase					:	int       =   norm_pix_loss






"""simple docstring"""





from __future__ import annotations



class 		snake_case_:






     def __init__(	self  :					int					,				UpperCamelCase_  :					str					,				UpperCamelCase_  :					str				):
           lowerCAmelCase,      lowerCAmelCase					:	List[str]       =   text, pattern
           lowerCAmelCase,      lowerCAmelCase					:	Union[str, Any]       =   len(UpperCamelCase_				), len(UpperCamelCase_				)






     def      lowerCamelCase__     (	self  :					List[Any]					,				UpperCamelCase_  :					str				):

           for i in range(self.patLen - 1					,				-1					,				-1				):
                 if char == self.pattern[i]:
                       return i
           return -1






     def      lowerCamelCase__     (	self  :					Optional[Any]					,				UpperCamelCase_  :					int				):

           for i in range(self.patLen - 1					,				-1					,				-1				):
                 if self.pattern[i] != self.text[current_pos + i]:
                       return current_pos + i
           return -1






     def      lowerCamelCase__     (	self  :					Dict				):
           # searches pattern in text and returns index positions
           lowerCAmelCase					:	Union[str, Any]       =   []
           for i in range(self.textLen - self.patLen + 1				):
                 lowerCAmelCase					:	str       =   self.mismatch_in_text(UpperCamelCase_				)
                 if mismatch_index == -1:
                       positions.append(UpperCamelCase_				)
                 else:
                       lowerCAmelCase					:	Optional[Any]       =   self.match_in_pattern(self.text[mismatch_index]				)
                       lowerCAmelCase					:	int       =   (
                           mismatch_index - match_index
                       )  # shifting index lgtm [py/multiple-definition]
           return positions



snake_case__		:     str    				=				'''ABAABA'''
snake_case__		:     List[str]    				=				'''AB'''
snake_case__		:     Union[str, Any]    				=				BoyerMooreSearch(text, pattern)
snake_case__		:     Optional[Any]    				=				bms.bad_character_heuristic()

if len(positions) == 0:
 print('''No match found''')
else:
 print('''Pattern found in following positions: ''')
 print(positions)


