def lowerCamelCase						(     SCREAMING_SNAKE_CASE						,    SCREAMING_SNAKE_CASE			):
    '''simple docstring'''







    __UpperCamelCase  :List[str]    						=	''''''
    for i in table:
        res += inp[i - 1]
    return res



def lowerCamelCase						(     SCREAMING_SNAKE_CASE			):
    '''simple docstring'''







    return data[1:] + data[0]



def lowerCamelCase						(     SCREAMING_SNAKE_CASE						,    SCREAMING_SNAKE_CASE			):
    '''simple docstring'''







    __UpperCamelCase  :Dict    						=	''''''
    for i in range(len(a_			)			):
        if a[i] == b[i]:
            res += "0"
        else:
            res += "1"
    return res



def lowerCamelCase						(     SCREAMING_SNAKE_CASE						,    SCREAMING_SNAKE_CASE			):
    '''simple docstring'''







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



def lowerCamelCase						(     SCREAMING_SNAKE_CASE						,    SCREAMING_SNAKE_CASE						,    SCREAMING_SNAKE_CASE						,    SCREAMING_SNAKE_CASE						,    SCREAMING_SNAKE_CASE			):
    '''simple docstring'''







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


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

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

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

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

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







import os
import unittest

from transformers.models.cpmant.tokenization_cpmant import VOCAB_FILES_NAMES, CpmAntTokenizer
from transformers.testing_utils import require_jieba, tooslow

from ...test_tokenization_common import TokenizerTesterMixin


@require_jieba
class 			lowerCamelCase_  (     UpperCAmelCase_		,			unittest.TestCase				):






    '''simple docstring'''






    a__			:		Any      			=   CpmAntTokenizer
    a__			:		Optional[Any]      			=   False







    def     UpperCamelCase__     (			self) ->			Any:
        super().setUp()

        __UpperCamelCase  :Optional[int]    						=	[
            '''<d>''',
            '''</d>''',
            '''<s>''',
            '''</s>''',
            '''</_>''',
            '''<unk>''',
            '''<pad>''',
            '''</n>''',
            '''我''',
            '''是''',
            '''C''',
            '''P''',
            '''M''',
            '''A''',
            '''n''',
            '''t''',
        ]
        __UpperCamelCase  :Optional[int]    						=	os.path.join(self.tmpdirname				,				VOCAB_FILES_NAMES['''vocab_file'''])
        with open(self.vocab_file				,				'''w'''				,				encoding='''utf-8''') as vocab_writer:
            vocab_writer.write(''''''.join([x + '''\n''' for x in vocab_tokens]))







    @tooslow
    def     UpperCamelCase__     (			self) ->			Dict:
        __UpperCamelCase  :Tuple    						=	CpmAntTokenizer.from_pretrained('''openbmb/cpm-ant-10b''')
        __UpperCamelCase  :Dict    						=	'''今天天气真好！'''
        __UpperCamelCase  :Tuple    						=	['''今天''', '''天气''', '''真''', '''好''', '''！''']
        __UpperCamelCase  :Optional[Any]    						=	tokenizer.tokenize(__lowercase)
        self.assertListEqual(__lowercase				,				__lowercase)
        __UpperCamelCase  :int    						=	'''今天天气真好！'''
        __UpperCamelCase  :List[str]    						=	[tokenizer.bos_token] + tokens

        __UpperCamelCase  :List[str]    						=	[6, 9_802, 14_962, 2_082, 831, 244]
        self.assertListEqual(tokenizer.convert_tokens_to_ids(__lowercase)				,				__lowercase)

        __UpperCamelCase  :Dict    						=	tokenizer.decode(__lowercase)
        self.assertEqual(__lowercase				,				__lowercase)





