






"""simple docstring"""
from ... import PretrainedConfig


lowerCamelCase_							      = {
    '''sijunhe/nezha-cn-base''': '''https://huggingface.co/sijunhe/nezha-cn-base/resolve/main/config.json''',
}







class      UpperCamelCase_			(__A	):
	__magic_name__       =							NEZHA_PRETRAINED_CONFIG_ARCHIVE_MAP
	__magic_name__       =							'''nezha'''





	def __init__( self   :					str      ,      lowerCAmelCase_   :					str=21_128      ,      lowerCAmelCase_   :					Dict=768      ,      lowerCAmelCase_   :					Tuple=12      ,      lowerCAmelCase_   :					Any=12      ,      lowerCAmelCase_   :					List[str]=3_072      ,      lowerCAmelCase_   :					Union[str, Any]="gelu"      ,      lowerCAmelCase_   :					Tuple=0.1      ,      lowerCAmelCase_   :					Any=0.1      ,      lowerCAmelCase_   :					List[str]=512      ,      lowerCAmelCase_   :					Union[str, Any]=64      ,      lowerCAmelCase_   :					List[Any]=2      ,      lowerCAmelCase_   :					Union[str, Any]=0.0_2      ,      lowerCAmelCase_   :					Dict=1e-12      ,      lowerCAmelCase_   :					Optional[int]=0.1      ,      lowerCAmelCase_   :					Optional[Any]=0      ,      lowerCAmelCase_   :					Tuple=2      ,      lowerCAmelCase_   :					Optional[Any]=3      ,      lowerCAmelCase_   :					List[str]=True      ,      **lowerCAmelCase_   :					str      ,      )		->     Union[str, Any]:
				super().__init__(pad_token_id=lowerCAmelCase_      ,      bos_token_id=lowerCAmelCase_      ,      eos_token_id=lowerCAmelCase_      ,      **lowerCAmelCase_		)

				UpperCAmelCase_	:					str     	=   vocab_size
				UpperCAmelCase_	:					Any     	=   hidden_size
				UpperCAmelCase_	:					Any     	=   num_hidden_layers
				UpperCAmelCase_	:					str     	=   num_attention_heads
				UpperCAmelCase_	:					Optional[Any]     	=   hidden_act
				UpperCAmelCase_	:					Optional[Any]     	=   intermediate_size
				UpperCAmelCase_	:					str     	=   hidden_dropout_prob
				UpperCAmelCase_	:					Optional[int]     	=   attention_probs_dropout_prob
				UpperCAmelCase_	:					Optional[int]     	=   max_position_embeddings
				UpperCAmelCase_	:					List[Any]     	=   max_relative_position
				UpperCAmelCase_	:					str     	=   type_vocab_size
				UpperCAmelCase_	:					List[str]     	=   initializer_range
				UpperCAmelCase_	:					Dict     	=   layer_norm_eps
				UpperCAmelCase_	:					Dict     	=   classifier_dropout
				UpperCAmelCase_	:					Union[str, Any]     	=   use_cache











"""simple docstring"""
def 							snake_case (  A__		):
			UpperCAmelCase_	:					int     	=   [0 for i in range(len(A__		)		)]

			# initialize interval's left pointer and right pointer
			UpperCAmelCase_	,      UpperCAmelCase_	:					Optional[int]     	=   0, 0

			for i in range(1      ,len(A__		)		):
						# case when current index is inside the interval
						if i <= right_pointer:
									UpperCAmelCase_	:					Any     	=   min(right_pointer - i + 1      ,z_result[i - left_pointer]		)
									UpperCAmelCase_	:					Union[str, Any]     	=   min_edge

						while go_next(A__      ,A__      ,A__		):
									z_result[i] += 1

						# if new index's result gives us more right interval,
						# we've to update left_pointer and right_pointer
						if i + z_result[i] - 1 > right_pointer:
									UpperCAmelCase_	,      UpperCAmelCase_	:					Union[str, Any]     	=   i, i + z_result[i] - 1

			return z_result

def 							snake_case (  A__      ,A__      ,A__		):
			return i + z_result[i] < len(A__		) and s[z_result[i]] == s[i + z_result[i]]

def 							snake_case (  A__      ,A__		):
			UpperCAmelCase_	:					Optional[int]     	=   0
			# concatenate 'pattern' and 'input_str' and call z_function
			# with concatenated string
			UpperCAmelCase_	:					Tuple     	=   z_function(pattern + input_str		)

			for val in z_result:
						# if value is greater then length of the pattern string
						# that means this index is starting position of substring
						# which is equal to pattern string
						if val >= len(A__		):
									answer += 1

			return answer


if __name__ == "__main__":
			import doctest

			doctest.testmod()



