






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


lowerCAmelCase_           = logging.get_logger(__name__)

lowerCAmelCase_           = {
    'tiiuae/falcon-40b': 'https://huggingface.co/tiiuae/falcon-40b/resolve/main/config.json',
    'tiiuae/falcon-7b': 'https://huggingface.co/tiiuae/falcon-7b/resolve/main/config.json',
}
class      UpperCamelCase (				snake_case__ ):







		"""simple docstring"""



		snake_case    =   "falcon"
		snake_case    =   ["past_key_values"]
		def __init__(  self		:       Union[str, Any]						,_SCREAMING_SNAKE_CASE		:       Tuple=6_5_0_2_4						,_SCREAMING_SNAKE_CASE		:       Tuple=4_5_4_4						,_SCREAMING_SNAKE_CASE		:       Any=3_2						,_SCREAMING_SNAKE_CASE		:       str=7_1						,_SCREAMING_SNAKE_CASE		:       Tuple=1E-5						,_SCREAMING_SNAKE_CASE		:       Optional[Any]=0.02						,_SCREAMING_SNAKE_CASE		:       Optional[Any]=True						,_SCREAMING_SNAKE_CASE		:       Any=0.0						,_SCREAMING_SNAKE_CASE		:       Any=0.0						,_SCREAMING_SNAKE_CASE		:       List[Any]=None						,_SCREAMING_SNAKE_CASE		:       Union[str, Any]=False						,_SCREAMING_SNAKE_CASE		:       int=False						,_SCREAMING_SNAKE_CASE		:       List[str]=True						,_SCREAMING_SNAKE_CASE		:       Optional[Any]=True						,_SCREAMING_SNAKE_CASE		:       Any=False						,_SCREAMING_SNAKE_CASE		:       Dict=1_1						,_SCREAMING_SNAKE_CASE		:       Tuple=1_1						,**_SCREAMING_SNAKE_CASE		:       List[Any]						,)    ->   int:


						'''simple docstring'''
						A	 =      vocab_size
						# Backward compatibility with n_embed kwarg
						A	 =      kwargs.pop('n_embed'						,_SCREAMING_SNAKE_CASE		)
						A	 =      hidden_size if n_embed is None else n_embed
						A	 =      num_hidden_layers
						A	 =      num_attention_heads
						A	 =      layer_norm_epsilon
						A	 =      initializer_range
						A	 =      use_cache
						A	 =      hidden_dropout
						A	 =      attention_dropout

						A	 =      bos_token_id
						A	 =      eos_token_id
						A	 =      num_attention_heads if num_kv_heads is None else num_kv_heads
						A	 =      alibi
						A	 =      new_decoder_architecture
						A	 =      multi_query  # Ignored when new_decoder_architecture is True
						A	 =      parallel_attn
						A	 =      bias

						super().__init__(bos_token_id=_SCREAMING_SNAKE_CASE						,eos_token_id=_SCREAMING_SNAKE_CASE						,**_SCREAMING_SNAKE_CASE		)
		@property
		def       A(  self		:       int		)    ->   List[Any]:


						'''simple docstring'''
						return self.hidden_size // self.num_attention_heads







		@property
		def       A(  self		:       List[Any]		)    ->   List[Any]:


						'''simple docstring'''
						return not self.alibi













def      snake_case		(							UpperCAmelCase	:       Optional[int],						UpperCAmelCase	:       Union[str, Any]   ):
				A	 =      ''
				for i in table:
								res += inp[i - 1]
				return res







def      snake_case		(							UpperCAmelCase	:       Union[str, Any]   ):
				return data[1:] + data[0]







def      snake_case		(							UpperCAmelCase	:       Union[str, Any],						UpperCAmelCase	:       Dict   ):
				A	 =      ''
				for i in range(len(UpperCAmelCase   )   ):
								if a[i] == b[i]:
												res += "0"
								else:
												res += "1"
				return res







def      snake_case		(							UpperCAmelCase	:       int,						UpperCAmelCase	:       Optional[Any]   ):
				A	 =      int('0b' + data[0] + data[-1],						2   )
				A	 =      int('0b' + data[1:3],						2   )
				return bin(s[row][col]   )[2:]







def      snake_case		(							UpperCAmelCase	:       Optional[Any],						UpperCAmelCase	:       Any,						UpperCAmelCase	:       Union[str, Any],						UpperCAmelCase	:       Optional[Any],						UpperCAmelCase	:       Optional[int]   ):
				A	 =      message[:4]
				A	 =      message[4:]
				A	 =      apply_table(UpperCAmelCase,						UpperCAmelCase   )
				A	 =      xor(UpperCAmelCase,						UpperCAmelCase   )
				A	 =      apply_sbox(UpperCAmelCase,						temp[:4]   )  # noqa: E741
				A	 =      apply_sbox(UpperCAmelCase,						temp[4:]   )
				A	 =      '0' * (2 - len(UpperCAmelCase   )) + l  # noqa: E741
				A	 =      '0' * (2 - len(UpperCAmelCase   )) + r
				A	 =      apply_table(l + r,						UpperCAmelCase   )
				A	 =      xor(UpperCAmelCase,						UpperCAmelCase   )
				return temp + right


if __name__ == "__main__":
					lowerCAmelCase_           = input('Enter 10 bit key: ')
					lowerCAmelCase_           = input('Enter 8 bit message: ')

					lowerCAmelCase_           = [6, 3, 7, 4, 8, 5, 10, 9]
					lowerCAmelCase_           = [3, 5, 2, 7, 4, 10, 1, 9, 8, 6]
					lowerCAmelCase_           = [2, 4, 3, 1]
					lowerCAmelCase_           = [2, 6, 3, 1, 4, 8, 5, 7]
					lowerCAmelCase_           = [4, 1, 3, 5, 7, 2, 8, 6]
					lowerCAmelCase_           = [4, 1, 2, 3, 2, 3, 4, 1]
					lowerCAmelCase_           = [[1, 0, 3, 2], [3, 2, 1, 0], [0, 2, 1, 3], [3, 1, 3, 2]]
					lowerCAmelCase_           = [[0, 1, 2, 3], [2, 0, 1, 3], [3, 0, 1, 0], [2, 1, 0, 3]]

					# key generation
					lowerCAmelCase_           = apply_table(key, paa_table)
					lowerCAmelCase_           = temp[:5]
					lowerCAmelCase_           = temp[5:]
					lowerCAmelCase_           = left_shift(left)
					lowerCAmelCase_           = left_shift(right)
					lowerCAmelCase_           = apply_table(left + right, pa_table)
					lowerCAmelCase_           = left_shift(left)
					lowerCAmelCase_           = left_shift(right)
					lowerCAmelCase_           = left_shift(left)
					lowerCAmelCase_           = left_shift(right)
					lowerCAmelCase_           = apply_table(left + right, pa_table)

					# encryption
					lowerCAmelCase_           = apply_table(message, IP)
					lowerCAmelCase_           = function(expansion, sa, sa, keya, temp)
					lowerCAmelCase_           = temp[4:] + temp[:4]
					lowerCAmelCase_           = function(expansion, sa, sa, keya, temp)
					lowerCAmelCase_           = apply_table(temp, IP_inv)
					print('Cipher text is:', CT)

					# decryption
					lowerCAmelCase_           = apply_table(CT, IP)
					lowerCAmelCase_           = function(expansion, sa, sa, keya, temp)
					lowerCAmelCase_           = temp[4:] + temp[:4]
					lowerCAmelCase_           = function(expansion, sa, sa, keya, temp)
					lowerCAmelCase_           = apply_table(temp, IP_inv)
					print('Plain text after decypting is:', PT)





