




def 					lowerCamelCase_    (    SCREAMING_SNAKE_CASE					,	SCREAMING_SNAKE_CASE   ):
			'''simple docstring'''
			SCREAMING_SNAKE_CASE           =					""""""
			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'''
			SCREAMING_SNAKE_CASE           =					""""""
			for i in range(len(SCREAMING_SNAKE_CASE   )   ):
						if a[i] == b[i]:
									res += "0"
						else:
									res += "1"
			return res
def 					lowerCamelCase_    (    SCREAMING_SNAKE_CASE					,	SCREAMING_SNAKE_CASE   ):
			'''simple docstring'''
			SCREAMING_SNAKE_CASE           =					int("""0b""" + data[0] + data[-1]					,	2   )
			SCREAMING_SNAKE_CASE           =					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'''
			SCREAMING_SNAKE_CASE           =					message[:4]
			SCREAMING_SNAKE_CASE           =					message[4:]
			SCREAMING_SNAKE_CASE           =					apply_table(SCREAMING_SNAKE_CASE					,	SCREAMING_SNAKE_CASE   )
			SCREAMING_SNAKE_CASE           =					xor(SCREAMING_SNAKE_CASE					,	SCREAMING_SNAKE_CASE   )
			SCREAMING_SNAKE_CASE           =					apply_sbox(SCREAMING_SNAKE_CASE					,	temp[:4]   )  # noqa: E741
			SCREAMING_SNAKE_CASE           =					apply_sbox(SCREAMING_SNAKE_CASE					,	temp[4:]   )
			SCREAMING_SNAKE_CASE           =					"""0""" * (2 - len(SCREAMING_SNAKE_CASE   )) + l  # noqa: E741
			SCREAMING_SNAKE_CASE           =					"""0""" * (2 - len(SCREAMING_SNAKE_CASE   )) + r
			SCREAMING_SNAKE_CASE           =					apply_table(l + r					,	SCREAMING_SNAKE_CASE   )
			SCREAMING_SNAKE_CASE           =					xor(SCREAMING_SNAKE_CASE					,	SCREAMING_SNAKE_CASE   )
			return temp + right


if __name__ == "__main__":
		__A						:							str							=  input("""Enter 10 bit key: """)
		__A						:							List[str]							=  input("""Enter 8 bit message: """)

		__A						:							Tuple							=  [6, 3, 7, 4, 8, 5, 1_0, 9]
		__A						:							Any							=  [3, 5, 2, 7, 4, 1_0, 1, 9, 8, 6]
		__A						:							str							=  [2, 4, 3, 1]
		__A						:							List[Any]							=  [2, 6, 3, 1, 4, 8, 5, 7]
		__A						:							str							=  [4, 1, 3, 5, 7, 2, 8, 6]
		__A						:							str							=  [4, 1, 2, 3, 2, 3, 4, 1]
		__A						:							Tuple							=  [[1, 0, 3, 2], [3, 2, 1, 0], [0, 2, 1, 3], [3, 1, 3, 2]]
		__A						:							List[Any]							=  [[0, 1, 2, 3], [2, 0, 1, 3], [3, 0, 1, 0], [2, 1, 0, 3]]

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

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

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









import os
import sys
import unittest


__A						:							Any							=  os.path.abspath(os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
sys.path.append(os.path.join(git_repo_path, """utils"""))

import check_dummies  # noqa: E402
from check_dummies import create_dummy_files, create_dummy_object, find_backend, read_init  # noqa: E402


# Align TRANSFORMERS_PATH in check_dummies with the current path
__A						:							List[Any]							=  os.path.join(git_repo_path, """src""", """diffusers""")




class 			UpperCAmelCase_      (   unittest.TestCase       ):




							'''simple docstring'''



							def    _UpperCAmelCase     (					self       :	Any			)			->					Optional[Any]:
										SCREAMING_SNAKE_CASE           =					find_backend("""    if not is_torch_available():"""			)
										self.assertEqual(a       ,     """torch"""			)

										# backend_with_underscore = find_backend("    if not is_tensorflow_text_available():")
										# self.assertEqual(backend_with_underscore, "tensorflow_text")

										SCREAMING_SNAKE_CASE           =					find_backend("""    if not (is_torch_available() and is_transformers_available()):"""			)
										self.assertEqual(a       ,     """torch_and_transformers"""			)

										# double_backend_with_underscore = find_backend(
										#    "    if not (is_sentencepiece_available() and is_tensorflow_text_available()):"
										# )
										# self.assertEqual(double_backend_with_underscore, "sentencepiece_and_tensorflow_text")

										SCREAMING_SNAKE_CASE           =					find_backend(
										    """    if not (is_torch_available() and is_transformers_available() and is_onnx_available()):"""			)
										self.assertEqual(a       ,     """torch_and_transformers_and_onnx"""			)





							def    _UpperCAmelCase     (					self       :	List[str]			)			->					int:
										SCREAMING_SNAKE_CASE           =					read_init()
										# We don't assert on the exact list of keys to allow for smooth grow of backend-specific objects
										self.assertIn("""torch"""       ,     a			)
										self.assertIn("""torch_and_transformers"""       ,     a			)
										self.assertIn("""flax_and_transformers"""       ,     a			)
										self.assertIn("""torch_and_transformers_and_onnx"""       ,     a			)

										# Likewise, we can't assert on the exact content of a key
										self.assertIn("""UNet2DModel"""       ,     objects["""torch"""]			)
										self.assertIn("""FlaxUNet2DConditionModel"""       ,     objects["""flax"""]			)
										self.assertIn("""StableDiffusionPipeline"""       ,     objects["""torch_and_transformers"""]			)
										self.assertIn("""FlaxStableDiffusionPipeline"""       ,     objects["""flax_and_transformers"""]			)
										self.assertIn("""LMSDiscreteScheduler"""       ,     objects["""torch_and_scipy"""]			)
										self.assertIn("""OnnxStableDiffusionPipeline"""       ,     objects["""torch_and_transformers_and_onnx"""]			)





							def    _UpperCAmelCase     (					self       :	Any			)			->					int:
										SCREAMING_SNAKE_CASE           =					create_dummy_object("""CONSTANT"""       ,     """'torch'"""			)
										self.assertEqual(a       ,     """\nCONSTANT = None\n"""			)

										SCREAMING_SNAKE_CASE           =					create_dummy_object("""function"""       ,     """'torch'"""			)
										self.assertEqual(
										    a       ,     """\ndef function(*args, **kwargs):\n    requires_backends(function, 'torch')\n"""			)

										SCREAMING_SNAKE_CASE           =					"""
class FakeClass(metaclass=DummyObject):
    _backends = 'torch'

    def __init__(self, *args, **kwargs):
        requires_backends(self, 'torch')

    @classmethod
    def from_config(cls, *args, **kwargs):
        requires_backends(cls, 'torch')

    @classmethod
    def from_pretrained(cls, *args, **kwargs):
        requires_backends(cls, 'torch')
"""
										SCREAMING_SNAKE_CASE           =					create_dummy_object("""FakeClass"""       ,     """'torch'"""			)
										self.assertEqual(a       ,     a			)







							def    _UpperCAmelCase     (					self       :	Union[str, Any]			)			->					Union[str, Any]:
										SCREAMING_SNAKE_CASE           =					"""# This file is autogenerated by the command `make fix-copies`, do not edit.
from ..utils import DummyObject, requires_backends


CONSTANT = None


def function(*args, **kwargs):
    requires_backends(function, [\"torch\"])


class FakeClass(metaclass=DummyObject):
    _backends = [\"torch\"]

    def __init__(self, *args, **kwargs):
        requires_backends(self, [\"torch\"])

    @classmethod
    def from_config(cls, *args, **kwargs):
        requires_backends(cls, [\"torch\"])

    @classmethod
    def from_pretrained(cls, *args, **kwargs):
        requires_backends(cls, [\"torch\"])
"""
										SCREAMING_SNAKE_CASE           =					create_dummy_files({"""torch""": ["""CONSTANT""", """function""", """FakeClass"""]}			)
										self.assertEqual(dummy_files["""torch"""]       ,     a			)






