





def      a__			(       lowercase__	,     lowercase__	):






   '''simple docstring'''






   UpperCAmelCase_           =""
   for i in table:
      res += inp[i - 1]
   return res




def      a__			(       lowercase__	):






   '''simple docstring'''






   return data[1:] + data[0]




def      a__			(       lowercase__	,     lowercase__	):






   '''simple docstring'''






   UpperCAmelCase_           =""
   for i in range(len(lowercase__	)	):
      if a[i] == b[i]:
         res += "0"
      else:
         res += "1"
   return res




def      a__			(       lowercase__	,     lowercase__	):






   '''simple docstring'''






   UpperCAmelCase_           =int("0b" + data[0] + data[-1]	,     2	)
   UpperCAmelCase_           =int("0b" + data[1:3]	,     2	)
   return bin(s[row][col]	)[2:]




def      a__			(       lowercase__	,     lowercase__	,     lowercase__	,     lowercase__	,     lowercase__	):






   '''simple docstring'''






   UpperCAmelCase_           =message[:4]
   UpperCAmelCase_           =message[4:]
   UpperCAmelCase_           =apply_table(lowercase__	,     lowercase__	)
   UpperCAmelCase_           =xor(lowercase__	,     lowercase__	)
   UpperCAmelCase_           =apply_sbox(lowercase__	,     temp[:4]	)  # noqa: E741
   UpperCAmelCase_           =apply_sbox(lowercase__	,     temp[4:]	)
   UpperCAmelCase_           ="0" * (2 - len(lowercase__	)) + l  # noqa: E741
   UpperCAmelCase_           ="0" * (2 - len(lowercase__	)) + r
   UpperCAmelCase_           =apply_table(l + r	,     lowercase__	)
   UpperCAmelCase_           =xor(lowercase__	,     lowercase__	)
   return temp + right


if __name__ == "__main__":
     __lowercase	: Union[str, Any]       =input("""Enter 10 bit key: """)
     __lowercase	: Optional[Any]       =input("""Enter 8 bit message: """)

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

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

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

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










'''simple docstring'''
import pytest

from datasets.splits import SplitDict, SplitInfo
from datasets.utils.py_utils import asdict





@pytest.mark.parametrize(
    'split_dict'       ,[
        SplitDict(),
        SplitDict({'train': SplitInfo(name='train'       ,num_bytes=1337       ,num_examples=42       ,dataset_name='my_dataset'     )}     ),
        SplitDict({'train': SplitInfo(name='train'       ,num_bytes=1337       ,num_examples=42     )}     ),
        SplitDict({'train': SplitInfo()}     ),
    ]       ,)
def 			lowerCamelCase(							SCREAMING_SNAKE_CASE_     )		->		List[str]:
			A_									= split_dict._to_yaml_list()
			assert len(SCREAMING_SNAKE_CASE_     ) == len(SCREAMING_SNAKE_CASE_     )
			A_									= SplitDict._from_yaml_list(SCREAMING_SNAKE_CASE_     )
			for split_name, split_info in split_dict.items():
						# dataset_name field is deprecated, and is therefore not part of the YAML dump
						A_									= None
						# the split name of split_dict takes over the name of the split info object
						A_									= split_name
			assert split_dict == reloaded






@pytest.mark.parametrize(
    'split_info'       ,[SplitInfo(), SplitInfo(dataset_name=SCREAMING_SNAKE_CASE_     ), SplitInfo(dataset_name='my_dataset'     )]     )
def 			lowerCamelCase(							SCREAMING_SNAKE_CASE_     )		->		Optional[Any]:
			# For backward compatibility, we need asdict(split_dict) to return split info dictrionaries with the "dataset_name"
			# field even if it's deprecated. This way old versionso of `datasets` can still reload dataset_infos.json files
			A_									= asdict(SplitDict({'train': split_info}     )     )
			assert "dataset_name" in split_dict_asdict["train"]
			assert split_dict_asdict["train"]["dataset_name"] == split_info.dataset_name




