






'''simple docstring'''

from collections.abc import Iterator, MutableMapping
from dataclasses import dataclass
from typing import Generic, TypeVar

A:      Dict  				=				TypeVar("KEY")
A:      Dict  				=				TypeVar("VAL")






@dataclass(frozen=UpperCAmelCase_,						slots=UpperCAmelCase_				)
class 							__magic_name__     (	Generic[KEY, VAL]				):







	"""simple docstring"""



	SCREAMING_SNAKE_CASE_					:      KEY
	SCREAMING_SNAKE_CASE_					:      VAL






class 							__magic_name__     (	_Item				):







	"""simple docstring"""



	def __init__(							self       )						->  None:
							super().__init__(_lowercase  ,      _lowercase       )







	def __bool__(							self       )						->  bool:
							return False


A:      Tuple  				=				_DeletedItem()






class 							__magic_name__     (	MutableMapping[KEY, VAL]				):







	"""simple docstring"""



	def __init__(							self  ,      _lowercase = 8  ,      _lowercase = 0.75       )						->  None:
							lowercase_      :   Dict        =			initial_block_size
							lowercase_      :   list[_Item | None]        =			[None] * initial_block_size
							assert 0.0 < capacity_factor < 1.0
							lowercase_      :   List[str]        =			capacity_factor
							lowercase_      :   Optional[Any]        =			0
	def        lowerCamelCase__		(							self  ,      _lowercase       )						->  int:
							return hash(_lowercase       ) % len(self._buckets       )
	def        lowerCamelCase__		(							self  ,      _lowercase       )						->  int:
							return (ind + 1) % len(self._buckets       )
	def        lowerCamelCase__		(							self  ,      _lowercase  ,      _lowercase  ,      _lowercase       )						->  bool:
							lowercase_      :   List[str]        =			self._buckets[ind]
							if not stored:
													lowercase_      :   int        =			_Item(_lowercase  ,      _lowercase       )
													self._len += 1
													return True
							elif stored.key == key:
													lowercase_      :   Tuple        =			_Item(_lowercase  ,      _lowercase       )
													return True
							else:
													return False
	def        lowerCamelCase__		(							self       )						->  bool:
							lowercase_      :   Tuple        =			len(self._buckets       ) * self._capacity_factor
							return len(self       ) >= int(_lowercase       )
	def        lowerCamelCase__		(							self       )						->  bool:
							if len(self._buckets       ) <= self._initial_block_size:
													return False
							lowercase_      :   Optional[int]        =			len(self._buckets       ) * self._capacity_factor / 2
							return len(self       ) < limit
	def        lowerCamelCase__		(							self  ,      _lowercase       )						->  None:
							lowercase_      :   int        =			self._buckets
							lowercase_      :   Dict        =			[None] * new_size
							lowercase_      :   str        =			0
							for item in old_buckets:
													if item:
																			self._add_item(item.key  ,      item.val       )
	def        lowerCamelCase__		(							self       )						->  None:
							self._resize(len(self._buckets       ) * 2       )
	def        lowerCamelCase__		(							self       )						->  None:
							self._resize(len(self._buckets       ) // 2       )
	def        lowerCamelCase__		(							self  ,      _lowercase       )						->  Iterator[int]:
							lowercase_      :   int        =			self._get_bucket_index(_lowercase       )
							for _ in range(len(self._buckets       )       ):
													yield ind
													lowercase_      :   Tuple        =			self._get_next_ind(_lowercase       )
	def        lowerCamelCase__		(							self  ,      _lowercase  ,      _lowercase       )						->  None:
							for ind in self._iterate_buckets(_lowercase       ):
													if self._try_set(_lowercase  ,      _lowercase  ,      _lowercase       ):
																			break
	def __setitem__(							self  ,      _lowercase  ,      _lowercase       )						->  None:
							if self._is_full():
													self._size_up()

							self._add_item(_lowercase  ,      _lowercase       )
	def __delitem__(							self  ,      _lowercase       )						->  None:
							for ind in self._iterate_buckets(_lowercase       ):
													lowercase_      :   Tuple        =			self._buckets[ind]
													if item is None:
																			raise KeyError(_lowercase       )
													if item is _deleted:
																			continue
													if item.key == key:
																			lowercase_      :   str        =			_deleted
																			self._len -= 1
																			break
							if self._is_sparse():
													self._size_down()
	def __getitem__(							self  ,      _lowercase       )						->  VAL:
							for ind in self._iterate_buckets(_lowercase       ):
													lowercase_      :   Optional[int]        =			self._buckets[ind]
													if item is None:
																			break
													if item is _deleted:
																			continue
													if item.key == key:
																			return item.val
							raise KeyError(_lowercase       )
	def __len__(							self       )						->  int:
							return self._len
	def __iter__(							self       )						->  Iterator[KEY]:
							yield from (item.key for item in self._buckets if item)







	def __repr__(							self       )						->  str:
							lowercase_      :   List[str]        =			' ,'.join(
							    f"{item.key}: {item.val}" for item in self._buckets if item       )
							return f"HashMap({val_string})"








'''simple docstring'''

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


A:      int  				=				logging.get_logger(__name__)

A:      int  				=				{
    "bigcode/gpt_bigcode-santacoder": "https://huggingface.co/bigcode/gpt_bigcode-santacoder/resolve/main/config.json",
}






class 							__magic_name__     (	UpperCAmelCase_				):







	"""simple docstring"""



	SCREAMING_SNAKE_CASE_					:      List[str]        =  'gpt_bigcode'
	SCREAMING_SNAKE_CASE_					:      int        =  ['past_key_values']
	SCREAMING_SNAKE_CASE_					:      Any        =  {
	    'hidden_size': 'n_embd',
	    'max_position_embeddings': 'n_positions',
	    'num_attention_heads': 'n_head',
	    'num_hidden_layers': 'n_layer',
	}
	def __init__(							self  ,      _lowercase=5_0257  ,      _lowercase=1024  ,      _lowercase=768  ,      _lowercase=12  ,      _lowercase=12  ,      _lowercase=None  ,      _lowercase="gelu_pytorch_tanh"  ,      _lowercase=0.1  ,      _lowercase=0.1  ,      _lowercase=0.1  ,      _lowercase=1E-5  ,      _lowercase=0.02  ,      _lowercase=True  ,      _lowercase=True  ,      _lowercase=5_0256  ,      _lowercase=5_0256  ,      _lowercase=True  ,      _lowercase=True  ,      _lowercase=True  ,      **_lowercase  ,      )						->  Any:
							lowercase_      :   Tuple        =			vocab_size
							lowercase_      :   str        =			n_positions
							lowercase_      :   List[str]        =			n_embd
							lowercase_      :   str        =			n_layer
							lowercase_      :   Optional[Any]        =			n_head
							lowercase_      :   Optional[int]        =			n_inner
							lowercase_      :   Union[str, Any]        =			activation_function
							lowercase_      :   Dict        =			resid_pdrop
							lowercase_      :   str        =			embd_pdrop
							lowercase_      :   Optional[Any]        =			attn_pdrop
							lowercase_      :   List[Any]        =			layer_norm_epsilon
							lowercase_      :   Optional[int]        =			initializer_range
							lowercase_      :   List[Any]        =			scale_attn_weights
							lowercase_      :   Any        =			use_cache
							lowercase_      :   List[str]        =			attention_softmax_in_fpaa
							lowercase_      :   Any        =			scale_attention_softmax_in_fpaa
							lowercase_      :   Optional[Any]        =			multi_query

							lowercase_      :   Optional[Any]        =			bos_token_id
							lowercase_      :   Optional[Any]        =			eos_token_id

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