






def 	lowerCAmelCase_		(lowercase__						:       Dict     ,					lowercase__						:       str       )		->    Dict:


				'''simple docstring'''




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





def 	lowerCAmelCase_		(lowercase__						:       Optional[int]       )		->    List[str]:


				'''simple docstring'''




				return data[1:] + data[0]





def 	lowerCAmelCase_		(lowercase__						:       List[str]     ,					lowercase__						:       Dict       )		->    Any:


				'''simple docstring'''




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





def 	lowerCAmelCase_		(lowercase__						:       str     ,					lowercase__						:       Optional[Any]       )		->    Union[str, Any]:


				'''simple docstring'''




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





def 	lowerCAmelCase_		(lowercase__						:       Union[str, Any]     ,					lowercase__						:       Dict     ,					lowercase__						:       Tuple     ,					lowercase__						:       Tuple     ,					lowercase__						:       Optional[Any]       )		->    str:


				'''simple docstring'''




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


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

			_UpperCAmelCase			:		Optional[Any]   				=    [6, 3, 7, 4, 8, 5, 10, 9]
			_UpperCAmelCase			:		Union[str, Any]   				=    [3, 5, 2, 7, 4, 10, 1, 9, 8, 6]
			_UpperCAmelCase			:		Optional[Any]   				=    [2, 4, 3, 1]
			_UpperCAmelCase			:		List[Any]   				=    [2, 6, 3, 1, 4, 8, 5, 7]
			_UpperCAmelCase			:		Tuple   				=    [4, 1, 3, 5, 7, 2, 8, 6]
			_UpperCAmelCase			:		List[Any]   				=    [4, 1, 2, 3, 2, 3, 4, 1]
			_UpperCAmelCase			:		str   				=    [[1, 0, 3, 2], [3, 2, 1, 0], [0, 2, 1, 3], [3, 1, 3, 2]]
			_UpperCAmelCase			:		Optional[Any]   				=    [[0, 1, 2, 3], [2, 0, 1, 3], [3, 0, 1, 0], [2, 1, 0, 3]]

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

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

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













import warnings

from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding
class  lowerCAmelCase_       (				snake_case__					):
							UpperCamelCase_		:Tuple		      =    ['image_processor', 'tokenizer']
							UpperCamelCase_		:Tuple		      =    'ViTImageProcessor'
							UpperCamelCase_		:Dict		      =    ('CLIPTokenizer', 'CLIPTokenizerFast')




							def __init__(   self     :   Union[str, Any] ,							SCREAMING_SNAKE_CASE_     :   Dict=None ,							SCREAMING_SNAKE_CASE_     :   Tuple=None ,							**SCREAMING_SNAKE_CASE_     :   Union[str, Any]	):
											lowerCAmelCase__      			=						None
											if "feature_extractor" in kwargs:
															warnings.warn(
															    '''The `feature_extractor` argument is deprecated and will be removed in v5, use `image_processor`'''
															    ''' instead.''' ,							SCREAMING_SNAKE_CASE_ ,							)
															lowerCAmelCase__      			=						kwargs.pop('''feature_extractor'''	)

											lowerCAmelCase__      			=						image_processor if image_processor is not None else feature_extractor
											if image_processor is None:
															raise ValueError('''You need to specify an `image_processor`.'''	)
											if tokenizer is None:
															raise ValueError('''You need to specify a `tokenizer`.'''	)

											super().__init__(SCREAMING_SNAKE_CASE_ ,							SCREAMING_SNAKE_CASE_	)




							def __call__(   self     :   Dict ,							SCREAMING_SNAKE_CASE_     :   Any=None ,							SCREAMING_SNAKE_CASE_     :   Tuple=None ,							SCREAMING_SNAKE_CASE_     :   Dict=None ,							SCREAMING_SNAKE_CASE_     :   Optional[int]=None ,							**SCREAMING_SNAKE_CASE_     :   Optional[int]	):
											if text is None and visual_prompt is None and images is None:
															raise ValueError('''You have to specify either text, visual prompt or images.'''	)

											if text is not None and visual_prompt is not None:
															raise ValueError('''You have to specify exactly one type of prompt. Either text or visual prompt.'''	)

											if text is not None:
															lowerCAmelCase__      			=						self.tokenizer(SCREAMING_SNAKE_CASE_ ,							return_tensors=SCREAMING_SNAKE_CASE_ ,							**SCREAMING_SNAKE_CASE_	)

											if visual_prompt is not None:
															lowerCAmelCase__      			=						self.image_processor(SCREAMING_SNAKE_CASE_ ,							return_tensors=SCREAMING_SNAKE_CASE_ ,							**SCREAMING_SNAKE_CASE_	)

											if images is not None:
															lowerCAmelCase__      			=						self.image_processor(SCREAMING_SNAKE_CASE_ ,							return_tensors=SCREAMING_SNAKE_CASE_ ,							**SCREAMING_SNAKE_CASE_	)

											if visual_prompt is not None and images is not None:
															lowerCAmelCase__      			=						{
															    '''pixel_values''': image_features.pixel_values,
															    '''conditional_pixel_values''': prompt_features.pixel_values,
															}
															return encoding
											elif text is not None and images is not None:
															lowerCAmelCase__      			=						image_features.pixel_values
															return encoding
											elif text is not None:
															return encoding
											elif visual_prompt is not None:
															lowerCAmelCase__      			=						{
															    '''conditional_pixel_values''': prompt_features.pixel_values,
															}
															return encoding
											else:
															return BatchEncoding(data=dict(**SCREAMING_SNAKE_CASE_	) ,							tensor_type=SCREAMING_SNAKE_CASE_	)




							def 						__snake_case					(   self     :   Union[str, Any] ,							*SCREAMING_SNAKE_CASE_     :   Union[str, Any] ,							**SCREAMING_SNAKE_CASE_     :   str	):
											return self.tokenizer.batch_decode(*SCREAMING_SNAKE_CASE_ ,							**SCREAMING_SNAKE_CASE_	)




							def 						__snake_case					(   self     :   Optional[int] ,							*SCREAMING_SNAKE_CASE_     :   Union[str, Any] ,							**SCREAMING_SNAKE_CASE_     :   Tuple	):
											return self.tokenizer.decode(*SCREAMING_SNAKE_CASE_ ,							**SCREAMING_SNAKE_CASE_	)




							@property
							def 						__snake_case					(   self     :   str	):
											warnings.warn(
											    '''`feature_extractor_class` is deprecated and will be removed in v5. Use `image_processor_class` instead.''' ,							SCREAMING_SNAKE_CASE_ ,							)
											return self.image_processor_class




							@property
							def 						__snake_case					(   self     :   Tuple	):
											warnings.warn(
											    '''`feature_extractor` is deprecated and will be removed in v5. Use `image_processor` instead.''' ,							SCREAMING_SNAKE_CASE_ ,							)
											return self.image_processor





