





def 						lowerCamelCase__     (     UpperCamelCase__			:       Tuple       ,    UpperCamelCase__			:       Tuple						)			-> Union[str, Any]:



					'''simple docstring'''




					_snake_case									=				''
					for i in table:
										res += inp[i - 1]
					return res





def 						lowerCamelCase__     (     UpperCamelCase__			:       Optional[int]						)			-> int:



					'''simple docstring'''




					return data[1:] + data[0]





def 						lowerCamelCase__     (     UpperCamelCase__			:       Union[str, Any]       ,    UpperCamelCase__			:       Optional[Any]						)			-> Optional[int]:



					'''simple docstring'''




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





def 						lowerCamelCase__     (     UpperCamelCase__			:       Union[str, Any]       ,    UpperCamelCase__			:       List[Any]						)			-> str:



					'''simple docstring'''




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





def 						lowerCamelCase__     (     UpperCamelCase__			:       int       ,    UpperCamelCase__			:       Dict       ,    UpperCamelCase__			:       List[Any]       ,    UpperCamelCase__			:       Dict       ,    UpperCamelCase__			:       List[Any]						)			-> List[Any]:



					'''simple docstring'''




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


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

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

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

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

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










from typing import TYPE_CHECKING

from ...utils import OptionalDependencyNotAvailable, _LazyModule, is_torch_available


UpperCAmelCase_      							=     {
    """configuration_bigbird_pegasus""": [
        """BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP""",
        """BigBirdPegasusConfig""",
        """BigBirdPegasusOnnxConfig""",
    ],
}

try:
					if not is_torch_available():
										raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
					pass
else:
					UpperCAmelCase_      							=     [
					    """BIGBIRD_PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST""",
					    """BigBirdPegasusForCausalLM""",
					    """BigBirdPegasusForConditionalGeneration""",
					    """BigBirdPegasusForQuestionAnswering""",
					    """BigBirdPegasusForSequenceClassification""",
					    """BigBirdPegasusModel""",
					    """BigBirdPegasusPreTrainedModel""",
					]


if TYPE_CHECKING:
					from .configuration_bigbird_pegasus import (
					    BIGBIRD_PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP,
					    BigBirdPegasusConfig,
					    BigBirdPegasusOnnxConfig,
					)

					try:
										if not is_torch_available():
															raise OptionalDependencyNotAvailable()
					except OptionalDependencyNotAvailable:
										pass
					else:
										from .modeling_bigbird_pegasus import (
										    BIGBIRD_PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST,
										    BigBirdPegasusForCausalLM,
										    BigBirdPegasusForConditionalGeneration,
										    BigBirdPegasusForQuestionAnswering,
										    BigBirdPegasusForSequenceClassification,
										    BigBirdPegasusModel,
										    BigBirdPegasusPreTrainedModel,
										)


else:
					import sys

					UpperCAmelCase_      							=     _LazyModule(__name__, globals()["""__file__"""], _import_structure, module_spec=__spec__)



