





'''simple docstring'''


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


_SCREAMING_SNAKE_CASE									=				logging.get_logger(__name__)

_SCREAMING_SNAKE_CASE									=				{
    # See all MEGATRON_BERT models at https://huggingface.co/models?filter=bert
}

class  lowerCAmelCase_		(		__magic_name__		):
 __lowerCamelCase    :				Any								=       "megatron-bert"




 def __init__(						self      ,  _lowerCAmelCase=29056      ,  _lowerCAmelCase=1024      ,  _lowerCAmelCase=24      ,  _lowerCAmelCase=16      ,  _lowerCAmelCase=4096      ,  _lowerCAmelCase="gelu"      ,  _lowerCAmelCase=0.1      ,  _lowerCAmelCase=0.1      ,  _lowerCAmelCase=512      ,  _lowerCAmelCase=2      ,  _lowerCAmelCase=0.02      ,  _lowerCAmelCase=1E-12      ,  _lowerCAmelCase=0      ,  _lowerCAmelCase="absolute"      ,  _lowerCAmelCase=True      ,  **_lowerCAmelCase      ,  )     ->				Optional[int]:
     super().__init__(pad_token_id=_lowerCAmelCase      ,  **_lowerCAmelCase		)

     _lowerCAmelCase						      =   vocab_size
     _lowerCAmelCase						      =   hidden_size
     _lowerCAmelCase						      =   num_hidden_layers
     _lowerCAmelCase						      =   num_attention_heads
     _lowerCAmelCase						      =   hidden_act
     _lowerCAmelCase						      =   intermediate_size
     _lowerCAmelCase						      =   hidden_dropout_prob
     _lowerCAmelCase						      =   attention_probs_dropout_prob
     _lowerCAmelCase						      =   max_position_embeddings
     _lowerCAmelCase						      =   type_vocab_size
     _lowerCAmelCase						      =   initializer_range
     _lowerCAmelCase						      =   layer_norm_eps
     _lowerCAmelCase						      =   position_embedding_type
     _lowerCAmelCase						      =   use_cache






def 						a__			(				A__,      A__				):
			SCREAMING_SNAKE_CASE_		:     Optional[Any]					=					''
			for i in table:
						res += inp[i - 1]
			return res






def 						a__			(				A__				):
			return data[1:] + data[0]






def 						a__			(				A__,      A__				):
			SCREAMING_SNAKE_CASE_		:     Optional[int]					=					''
			for i in range(len(A__				)				):
						if a[i] == b[i]:
									res += "0"
						else:
									res += "1"
			return res






def 						a__			(				A__,      A__				):
			SCREAMING_SNAKE_CASE_		:     Tuple					=					int('0b' + data[0] + data[-1],      2				)
			SCREAMING_SNAKE_CASE_		:     Tuple					=					int('0b' + data[1:3],      2				)
			return bin(s[row][col]				)[2:]






def 						a__			(				A__,      A__,      A__,      A__,      A__				):
			SCREAMING_SNAKE_CASE_		:     List[Any]					=					message[:4]
			SCREAMING_SNAKE_CASE_		:     int					=					message[4:]
			SCREAMING_SNAKE_CASE_		:     List[str]					=					apply_table(A__,      A__				)
			SCREAMING_SNAKE_CASE_		:     Dict					=					xor(A__,      A__				)
			SCREAMING_SNAKE_CASE_		:     Any					=					apply_sbox(A__,      temp[:4]				)  # noqa: E741
			SCREAMING_SNAKE_CASE_		:     List[Any]					=					apply_sbox(A__,      temp[4:]				)
			SCREAMING_SNAKE_CASE_		:     Any					=					'0' * (2 - len(A__				)) + l  # noqa: E741
			SCREAMING_SNAKE_CASE_		:     List[Any]					=					'0' * (2 - len(A__				)) + r
			SCREAMING_SNAKE_CASE_		:     Optional[int]					=					apply_table(l + r,      A__				)
			SCREAMING_SNAKE_CASE_		:     Dict					=					xor(A__,      A__				)
			return temp + right


if __name__ == "__main__":
				lowerCAmelCase__			:      Optional[Any]								=input('Enter 10 bit key: ')
				lowerCAmelCase__			:      int								=input('Enter 8 bit message: ')

				lowerCAmelCase__			:      Any								=[6, 3, 7, 4, 8, 5, 10, 9]
				lowerCAmelCase__			:      List[str]								=[3, 5, 2, 7, 4, 10, 1, 9, 8, 6]
				lowerCAmelCase__			:      Dict								=[2, 4, 3, 1]
				lowerCAmelCase__			:      Dict								=[2, 6, 3, 1, 4, 8, 5, 7]
				lowerCAmelCase__			:      Union[str, Any]								=[4, 1, 3, 5, 7, 2, 8, 6]
				lowerCAmelCase__			:      Dict								=[4, 1, 2, 3, 2, 3, 4, 1]
				lowerCAmelCase__			:      str								=[[1, 0, 3, 2], [3, 2, 1, 0], [0, 2, 1, 3], [3, 1, 3, 2]]
				lowerCAmelCase__			:      Any								=[[0, 1, 2, 3], [2, 0, 1, 3], [3, 0, 1, 0], [2, 1, 0, 3]]

				# key generation
				lowerCAmelCase__			:      Dict								=apply_table(key, paa_table)
				lowerCAmelCase__			:      List[str]								=temp[:5]
				lowerCAmelCase__			:      List[Any]								=temp[5:]
				lowerCAmelCase__			:      Tuple								=left_shift(left)
				lowerCAmelCase__			:      Optional[Any]								=left_shift(right)
				lowerCAmelCase__			:      Optional[int]								=apply_table(left + right, pa_table)
				lowerCAmelCase__			:      Optional[Any]								=left_shift(left)
				lowerCAmelCase__			:      Optional[Any]								=left_shift(right)
				lowerCAmelCase__			:      List[str]								=left_shift(left)
				lowerCAmelCase__			:      Optional[int]								=left_shift(right)
				lowerCAmelCase__			:      Tuple								=apply_table(left + right, pa_table)

				# encryption
				lowerCAmelCase__			:      Tuple								=apply_table(message, IP)
				lowerCAmelCase__			:      List[Any]								=function(expansion, sa, sa, keya, temp)
				lowerCAmelCase__			:      str								=temp[4:] + temp[:4]
				lowerCAmelCase__			:      Optional[Any]								=function(expansion, sa, sa, keya, temp)
				lowerCAmelCase__			:      Optional[int]								=apply_table(temp, IP_inv)
				print('Cipher text is:', CT)

				# decryption
				lowerCAmelCase__			:      Union[str, Any]								=apply_table(CT, IP)
				lowerCAmelCase__			:      Tuple								=function(expansion, sa, sa, keya, temp)
				lowerCAmelCase__			:      Union[str, Any]								=temp[4:] + temp[:4]
				lowerCAmelCase__			:      Dict								=function(expansion, sa, sa, keya, temp)
				lowerCAmelCase__			:      int								=apply_table(temp, IP_inv)
				print('Plain text after decypting is:', PT)





