def 						A__  (					__A   , __A	):







    '''simple docstring'''
    _lowerCamelCase     :		Optional[int] 						=						""""""
    for i in table:
        res += inp[i - 1]
    return res







def 						A__  (					__A	):







    '''simple docstring'''
    return data[1:] + data[0]







def 						A__  (					__A   , __A	):







    '''simple docstring'''
    _lowerCamelCase     :		Any 						=						""""""
    for i in range(len(__A	)	):
        if a[i] == b[i]:
            res += "0"
        else:
            res += "1"
    return res







def 						A__  (					__A   , __A	):







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







def 						A__  (					__A   , __A   , __A   , __A   , __A	):







    '''simple docstring'''
    _lowerCamelCase     :		Dict 						=						message[:4]
    _lowerCamelCase     :		Any 						=						message[4:]
    _lowerCamelCase     :		int 						=						apply_table(__A   , __A	)
    _lowerCamelCase     :		Dict 						=						xor(__A   , __A	)
    _lowerCamelCase     :		Union[str, Any] 						=						apply_sbox(__A   , temp[:4]	)  # noqa: E741
    _lowerCamelCase     :		int 						=						apply_sbox(__A   , temp[4:]	)
    _lowerCamelCase     :		int 						=						"""0""" * (2 - len(__A	)) + l  # noqa: E741
    _lowerCamelCase     :		List[Any] 						=						"""0""" * (2 - len(__A	)) + r
    _lowerCamelCase     :		str 						=						apply_table(l + r   , __A	)
    _lowerCamelCase     :		Optional[int] 						=						xor(__A   , __A	)
    return temp + right


if __name__ == "__main__":
    lowerCAmelCase			:							Any     =input("Enter 10 bit key: ")
    lowerCAmelCase			:							Any     =input("Enter 8 bit message: ")

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

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

    # encryption
    lowerCAmelCase			:							Union[str, Any]     =apply_table(message, IP)
    lowerCAmelCase			:							Optional[int]     =function(expansion, sa, sa, keya, temp)
    lowerCAmelCase			:							int     =temp[4:] + temp[:4]
    lowerCAmelCase			:							Any     =function(expansion, sa, sa, keya, temp)
    lowerCAmelCase			:							Dict     =apply_table(temp, IP_inv)
    print("Cipher text is:", CT)

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





from typing import Optional

from .. import Features, NamedSplit
from ..packaged_modules.text.text import Text
from ..utils.typing import NestedDataStructureLike, PathLike
from .abc import AbstractDatasetReader




class 	__snake_case	( __lowerCAmelCase		):





      '''simple docstring'''






      def __init__(					self     :				Dict    ,  _UpperCamelCase     :				NestedDataStructureLike[PathLike]    ,  _UpperCamelCase     :				Optional[NamedSplit] = None    ,  _UpperCamelCase     :				Optional[Features] = None    ,  _UpperCamelCase     :				str = None    ,  _UpperCamelCase     :				bool = False    ,  _UpperCamelCase     :				bool = False    ,  _UpperCamelCase     :				Optional[int] = None    ,  **_UpperCamelCase     :				Tuple    ,  )				->Union[str, Any]:


          """simple docstring"""


          super().__init__(
              _UpperCamelCase    ,  split=_UpperCamelCase    ,  features=_UpperCamelCase    ,  cache_dir=_UpperCamelCase    ,  keep_in_memory=_UpperCamelCase    ,  streaming=_UpperCamelCase    ,  num_proc=_UpperCamelCase    ,  **_UpperCamelCase    ,  )
          _lowerCamelCase     :		List[Any] 						=						path_or_paths if isinstance(_UpperCamelCase    ,  _UpperCamelCase) else {self.split: path_or_paths}
          _lowerCamelCase     :		Any 						=						Text(
              cache_dir=_UpperCamelCase    ,  data_files=_UpperCamelCase    ,  features=_UpperCamelCase    ,  **_UpperCamelCase    ,  )




      def 	_SCREAMING_SNAKE_CASE    (					self     :				Optional[Any])				->Optional[Any]:


          """simple docstring"""


          if self.streaming:
              _lowerCamelCase     :		Tuple 						=						self.builder.as_streaming_dataset(split=self.split)
          # Build regular (map-style) dataset
          else:
              _lowerCamelCase     :		List[Any] 						=						None
              _lowerCamelCase     :		Any 						=						None
              _lowerCamelCase     :		List[str] 						=						None
              _lowerCamelCase     :		Dict 						=						None

              self.builder.download_and_prepare(
                  download_config=_UpperCamelCase    ,  download_mode=_UpperCamelCase    ,  verification_mode=_UpperCamelCase    ,  base_path=_UpperCamelCase    ,  num_proc=self.num_proc    ,  )
              _lowerCamelCase     :		Optional[int] 						=						self.builder.as_dataset(
                  split=self.split    ,  verification_mode=_UpperCamelCase    ,  in_memory=self.keep_in_memory)
          return dataset




