


def 				UpperCAmelCase_					(							__snake_case     ,						__snake_case						)     ->			Optional[int]:







 """simple docstring"""


 _lowercase							      =''''''
 for i in table:
  res += inp[i - 1]
 return res
def 				UpperCAmelCase_					(							__snake_case						)     ->			int:







 """simple docstring"""


 return data[1:] + data[0]
def 				UpperCAmelCase_					(							__snake_case     ,						__snake_case						)     ->			Dict:







 """simple docstring"""


 _lowercase							      =''''''
 for i in range(len(__snake_case						)						):
  if a[i] == b[i]:
   res += "0"
  else:
   res += "1"
 return res
def 				UpperCAmelCase_					(							__snake_case     ,						__snake_case						)     ->			List[Any]:







 """simple docstring"""


 _lowercase							      =int('''0b''' + data[0] + data[-1]     ,						2						)
 _lowercase							      =int('''0b''' + data[1:3]     ,						2						)
 return bin(s[row][col]						)[2:]
def 				UpperCAmelCase_					(							__snake_case     ,						__snake_case     ,						__snake_case     ,						__snake_case     ,						__snake_case						)     ->			Dict:







 """simple docstring"""


 _lowercase							      =message[:4]
 _lowercase							      =message[4:]
 _lowercase							      =apply_table(__snake_case     ,						__snake_case						)
 _lowercase							      =xor(__snake_case     ,						__snake_case						)
 _lowercase							      =apply_sbox(__snake_case     ,						temp[:4]						)  # noqa: E741
 _lowercase							      =apply_sbox(__snake_case     ,						temp[4:]						)
 _lowercase							      ='''0''' * (2 - len(__snake_case						)) + l  # noqa: E741
 _lowercase							      ='''0''' * (2 - len(__snake_case						)) + r
 _lowercase							      =apply_table(l + r     ,						__snake_case						)
 _lowercase							      =xor(__snake_case     ,						__snake_case						)
 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_timesformer''': ['''TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP''', '''TimesformerConfig'''],
}

try:
  if not is_torch_available():
    raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
  pass
else:
  UpperCAmelCase__   	=							[
      '''TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST''',
      '''TimesformerModel''',
      '''TimesformerForVideoClassification''',
      '''TimesformerPreTrainedModel''',
  ]

if TYPE_CHECKING:
  from .configuration_timesformer import TIMESFORMER_PRETRAINED_CONFIG_ARCHIVE_MAP, TimesformerConfig

  try:
    if not is_torch_available():
      raise OptionalDependencyNotAvailable()
  except OptionalDependencyNotAvailable:
    pass
  else:
    from .modeling_timesformer import (
        TIMESFORMER_PRETRAINED_MODEL_ARCHIVE_LIST,
        TimesformerForVideoClassification,
        TimesformerModel,
        TimesformerPreTrainedModel,
    )

else:
  import sys

  UpperCAmelCase__   	=							_LazyModule(__name__, globals()['''__file__'''], _import_structure, module_spec=__spec__)

