




"""simple docstring"""

from __future__ import annotations






def 		_snake_case	(   _snake_case				:   str							,    _snake_case				:   str				)       ->   bool:






      '''simple docstring'''


      _A     =  get_failure_array(_snake_case				)

      # 2) Step through text searching for pattern
      _A  ,       _A     =  0, 0  # index into text, pattern
      while i < len(_snake_case				):
            if pattern[j] == text[i]:
                  if j == (len(_snake_case				) - 1):
                        return True
                  j += 1

            # if this is a prefix in our pattern
            # just go back far enough to continue
            elif j > 0:
                  _A     =  failure[j - 1]
                  continue
            i += 1
      return False






def 		_snake_case	(   _snake_case				:   str				)       ->   list[int]:






      '''simple docstring'''


      _A     =  [0]
      _A     =  0
      _A     =  1
      while j < len(_snake_case				):
            if pattern[i] == pattern[j]:
                  i += 1
            elif i > 0:
                  _A     =  failure[i - 1]
                  continue
            j += 1
            failure.append(_snake_case				)
      return failure


if __name__ == "__main__":
       # Test 1)
       a							      =     '''abc1abc12'''
       a							      =     '''alskfjaldsabc1abc1abc12k23adsfabcabc'''
       a							      =     '''alskfjaldsk23adsfabcabc'''
       assert kmp(pattern, texta) and not kmp(pattern, texta)

       # Test 2)
       a							      =     '''ABABX'''
       a							      =     '''ABABZABABYABABX'''
       assert kmp(pattern, text)

       # Test 3)
       a							      =     '''AAAB'''
       a							      =     '''ABAAAAAB'''
       assert kmp(pattern, text)

       # Test 4)
       a							      =     '''abcdabcy'''
       a							      =     '''abcxabcdabxabcdabcdabcy'''
       assert kmp(pattern, text)

       # Test 5)
       a							      =     '''aabaabaaa'''
       assert get_failure_array(pattern) == [0, 1, 0, 1, 2, 3, 4, 5, 2]







"""simple docstring"""

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


a							      =     logging.get_logger(__name__)

a							      =     {
    '''bigcode/gpt_bigcode-santacoder''': '''https://huggingface.co/bigcode/gpt_bigcode-santacoder/resolve/main/config.json''',
}





class 							lowercase_			(	__lowerCAmelCase				):



 '''simple docstring'''
 UpperCAmelCase       :	int     =      '''gpt_bigcode'''
 UpperCAmelCase       :	str     =      ['''past_key_values''']
 UpperCAmelCase       :	Dict     =      {
     '''hidden_size''': '''n_embd''',
     '''max_position_embeddings''': '''n_positions''',
     '''num_attention_heads''': '''n_head''',
     '''num_hidden_layers''': '''n_layer''',
 }

 def __init__(					self			:			Tuple       ,				_UpperCAmelCase			:			Dict=50_257       ,				_UpperCAmelCase			:			List[Any]=1_024       ,				_UpperCAmelCase			:			Any=768       ,				_UpperCAmelCase			:			int=12       ,				_UpperCAmelCase			:			Any=12       ,				_UpperCAmelCase			:			Tuple=None       ,				_UpperCAmelCase			:			str="gelu_pytorch_tanh"       ,				_UpperCAmelCase			:			str=0.1       ,				_UpperCAmelCase			:			Optional[Any]=0.1       ,				_UpperCAmelCase			:			Tuple=0.1       ,				_UpperCAmelCase			:			List[Any]=1E-5       ,				_UpperCAmelCase			:			List[Any]=0.02       ,				_UpperCAmelCase			:			Optional[Any]=True       ,				_UpperCAmelCase			:			Dict=True       ,				_UpperCAmelCase			:			List[Any]=50_256       ,				_UpperCAmelCase			:			Dict=50_256       ,				_UpperCAmelCase			:			int=True       ,				_UpperCAmelCase			:			Union[str, Any]=True       ,				_UpperCAmelCase			:			Any=True       ,				**_UpperCAmelCase			:			Any       ,				):
       _A     =  vocab_size
       _A     =  n_positions
       _A     =  n_embd
       _A     =  n_layer
       _A     =  n_head
       _A     =  n_inner
       _A     =  activation_function
       _A     =  resid_pdrop
       _A     =  embd_pdrop
       _A     =  attn_pdrop
       _A     =  layer_norm_epsilon
       _A     =  initializer_range
       _A     =  scale_attn_weights
       _A     =  use_cache
       _A     =  attention_softmax_in_fpaa
       _A     =  scale_attention_softmax_in_fpaa
       _A     =  multi_query

       _A     =  bos_token_id
       _A     =  eos_token_id

       super().__init__(bos_token_id=_UpperCAmelCase       ,				eos_token_id=_UpperCAmelCase       ,				**_UpperCAmelCase						)

