






"""simple docstring"""



import unittest

from transformers import XLMConfig, is_torch_available
from transformers.testing_utils import require_torch, slow, torch_device

from ...generation.test_utils import GenerationTesterMixin
from ...test_configuration_common import ConfigTester
from ...test_modeling_common import ModelTesterMixin, ids_tensor, random_attention_mask
from ...test_pipeline_mixin import PipelineTesterMixin


if is_torch_available():
    import torch

    from transformers import (
        XLMForMultipleChoice,
        XLMForQuestionAnswering,
        XLMForQuestionAnsweringSimple,
        XLMForSequenceClassification,
        XLMForTokenClassification,
        XLMModel,
        XLMWithLMHeadModel,
    )
    from transformers.models.xlm.modeling_xlm import XLM_PRETRAINED_MODEL_ARCHIVE_LIST

class        a     :







    def __init__(			self							,		_lowerCamelCase							,		_lowerCamelCase=1_3							,		_lowerCamelCase=7							,		_lowerCamelCase=True							,		_lowerCamelCase=True							,		_lowerCamelCase=True							,		_lowerCamelCase=True							,		_lowerCamelCase=True							,		_lowerCamelCase=False							,		_lowerCamelCase=False							,		_lowerCamelCase=False							,		_lowerCamelCase=2							,		_lowerCamelCase=9_9							,		_lowerCamelCase=0							,		_lowerCamelCase=3_2							,		_lowerCamelCase=5							,		_lowerCamelCase=4							,		_lowerCamelCase=0.1							,		_lowerCamelCase=0.1							,		_lowerCamelCase=5_1_2							,		_lowerCamelCase=2							,		_lowerCamelCase=0.0_2							,		_lowerCamelCase=2							,		_lowerCamelCase=4							,		_lowerCamelCase="last"							,		_lowerCamelCase=True							,		_lowerCamelCase=None							,		_lowerCamelCase=0							,		):
      lowercase							    =       parent
      lowercase							    =       batch_size
      lowercase							    =       seq_length
      lowercase							    =       is_training
      lowercase							    =       use_input_lengths
      lowercase							    =       use_token_type_ids
      lowercase							    =       use_labels
      lowercase							    =       gelu_activation
      lowercase							    =       sinusoidal_embeddings
      lowercase							    =       causal
      lowercase							    =       asm
      lowercase							    =       n_langs
      lowercase							    =       vocab_size
      lowercase							    =       n_special
      lowercase							    =       hidden_size
      lowercase							    =       num_hidden_layers
      lowercase							    =       num_attention_heads
      lowercase							    =       hidden_dropout_prob
      lowercase							    =       attention_probs_dropout_prob
      lowercase							    =       max_position_embeddings
      lowercase							    =       type_sequence_label_size
      lowercase							    =       initializer_range
      lowercase							    =       num_labels
      lowercase							    =       num_choices
      lowercase							    =       summary_type
      lowercase							    =       use_proj
      lowercase							    =       scope
      lowercase							    =       bos_token_id







    def 			UpperCamelCase_      (			self       ):
      lowercase							    =       ids_tensor([self.batch_size, self.seq_length]							,		self.vocab_size       )
      lowercase							    =       random_attention_mask([self.batch_size, self.seq_length]       )

      lowercase							    =       None
      if self.use_input_lengths:
        lowercase							    =       (
            ids_tensor([self.batch_size]							,		vocab_size=2       ) + self.seq_length - 2
        )  # small variation of seq_length

      lowercase							    =       None
      if self.use_token_type_ids:
        lowercase							    =       ids_tensor([self.batch_size, self.seq_length]							,		self.n_langs       )

      lowercase							    =       None
      lowercase							    =       None
      lowercase							    =       None
      if self.use_labels:
        lowercase							    =       ids_tensor([self.batch_size]							,		self.type_sequence_label_size       )
        lowercase							    =       ids_tensor([self.batch_size, self.seq_length]							,		self.num_labels       )
        lowercase							    =       ids_tensor([self.batch_size]							,		2       ).float()
        lowercase							    =       ids_tensor([self.batch_size]							,		self.num_choices       )

      lowercase							    =       self.get_config()

      return (
          config,
          input_ids,
          token_type_ids,
          input_lengths,
          sequence_labels,
          token_labels,
          is_impossible_labels,
          choice_labels,
          input_mask,
      )







    def 			UpperCamelCase_      (			self       ):
      return XLMConfig(
          vocab_size=self.vocab_size							,		n_special=self.n_special							,		emb_dim=self.hidden_size							,		n_layers=self.num_hidden_layers							,		n_heads=self.num_attention_heads							,		dropout=self.hidden_dropout_prob							,		attention_dropout=self.attention_probs_dropout_prob							,		gelu_activation=self.gelu_activation							,		sinusoidal_embeddings=self.sinusoidal_embeddings							,		asm=self.asm							,		causal=self.causal							,		n_langs=self.n_langs							,		max_position_embeddings=self.max_position_embeddings							,		initializer_range=self.initializer_range							,		summary_type=self.summary_type							,		use_proj=self.use_proj							,		num_labels=self.num_labels							,		bos_token_id=self.bos_token_id							,		)







    def 			UpperCamelCase_      (			self							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		):
      lowercase							    =       XLMModel(config=_lowerCamelCase       )
      model.to(_lowerCamelCase       )
      model.eval()
      lowercase							    =       model(_lowerCamelCase							,		lengths=_lowerCamelCase							,		langs=_lowerCamelCase       )
      lowercase							    =       model(_lowerCamelCase							,		langs=_lowerCamelCase       )
      lowercase							    =       model(_lowerCamelCase       )
      self.parent.assertEqual(result.last_hidden_state.shape							,		(self.batch_size, self.seq_length, self.hidden_size)       )







    def 			UpperCamelCase_      (			self							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		):
      lowercase							    =       XLMWithLMHeadModel(_lowerCamelCase       )
      model.to(_lowerCamelCase       )
      model.eval()

      lowercase							    =       model(_lowerCamelCase							,		token_type_ids=_lowerCamelCase							,		labels=_lowerCamelCase       )
      self.parent.assertEqual(result.loss.shape							,		()       )
      self.parent.assertEqual(result.logits.shape							,		(self.batch_size, self.seq_length, self.vocab_size)       )







    def 			UpperCamelCase_      (			self							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		):
      lowercase							    =       XLMForQuestionAnsweringSimple(_lowerCamelCase       )
      model.to(_lowerCamelCase       )
      model.eval()

      lowercase							    =       model(_lowerCamelCase       )

      lowercase							    =       model(_lowerCamelCase							,		start_positions=_lowerCamelCase							,		end_positions=_lowerCamelCase       )
      lowercase							    =       outputs
      self.parent.assertEqual(result.start_logits.shape							,		(self.batch_size, self.seq_length)       )
      self.parent.assertEqual(result.end_logits.shape							,		(self.batch_size, self.seq_length)       )







    def 			UpperCamelCase_      (			self							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		):
      lowercase							    =       XLMForQuestionAnswering(_lowerCamelCase       )
      model.to(_lowerCamelCase       )
      model.eval()

      lowercase							    =       model(_lowerCamelCase       )

      lowercase							    =       model(
          _lowerCamelCase							,		start_positions=_lowerCamelCase							,		end_positions=_lowerCamelCase							,		cls_index=_lowerCamelCase							,		is_impossible=_lowerCamelCase							,		p_mask=_lowerCamelCase							,		)

      lowercase							    =       model(
          _lowerCamelCase							,		start_positions=_lowerCamelCase							,		end_positions=_lowerCamelCase							,		cls_index=_lowerCamelCase							,		is_impossible=_lowerCamelCase							,		)

      ((lowercase)    ,     )							    =       result_with_labels.to_tuple()

      lowercase							    =       model(_lowerCamelCase							,		start_positions=_lowerCamelCase							,		end_positions=_lowerCamelCase       )

      ((lowercase)    ,     )							    =       result_with_labels.to_tuple()

      self.parent.assertEqual(result_with_labels.loss.shape							,		()       )
      self.parent.assertEqual(result.start_top_log_probs.shape							,		(self.batch_size, model.config.start_n_top)       )
      self.parent.assertEqual(result.start_top_index.shape							,		(self.batch_size, model.config.start_n_top)       )
      self.parent.assertEqual(
          result.end_top_log_probs.shape							,		(self.batch_size, model.config.start_n_top * model.config.end_n_top)       )
      self.parent.assertEqual(
          result.end_top_index.shape							,		(self.batch_size, model.config.start_n_top * model.config.end_n_top)       )
      self.parent.assertEqual(result.cls_logits.shape							,		(self.batch_size,)       )







    def 			UpperCamelCase_      (			self							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		):
      lowercase							    =       XLMForSequenceClassification(_lowerCamelCase       )
      model.to(_lowerCamelCase       )
      model.eval()

      lowercase							    =       model(_lowerCamelCase       )
      lowercase							    =       model(_lowerCamelCase							,		labels=_lowerCamelCase       )
      self.parent.assertEqual(result.loss.shape							,		()       )
      self.parent.assertEqual(result.logits.shape							,		(self.batch_size, self.type_sequence_label_size)       )







    def 			UpperCamelCase_      (			self							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		):
      lowercase							    =       self.num_labels
      lowercase							    =       XLMForTokenClassification(_lowerCamelCase       )
      model.to(_lowerCamelCase       )
      model.eval()

      lowercase							    =       model(_lowerCamelCase							,		attention_mask=_lowerCamelCase							,		labels=_lowerCamelCase       )
      self.parent.assertEqual(result.logits.shape							,		(self.batch_size, self.seq_length, self.num_labels)       )







    def 			UpperCamelCase_      (			self							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		):
      lowercase							    =       self.num_choices
      lowercase							    =       XLMForMultipleChoice(config=_lowerCamelCase       )
      model.to(_lowerCamelCase       )
      model.eval()
      lowercase							    =       input_ids.unsqueeze(1       ).expand(-1							,		self.num_choices							,		-1       ).contiguous()
      lowercase							    =       token_type_ids.unsqueeze(1       ).expand(-1							,		self.num_choices							,		-1       ).contiguous()
      lowercase							    =       input_mask.unsqueeze(1       ).expand(-1							,		self.num_choices							,		-1       ).contiguous()
      lowercase							    =       model(
          _lowerCamelCase							,		attention_mask=_lowerCamelCase							,		token_type_ids=_lowerCamelCase							,		labels=_lowerCamelCase							,		)
      self.parent.assertEqual(result.logits.shape							,		(self.batch_size, self.num_choices)       )







    def 			UpperCamelCase_      (			self       ):
      lowercase							    =       self.prepare_config_and_inputs()
      (
          (
          lowercase
      )    ,     (
          lowercase
      )    ,     (
          lowercase
      )    ,     (
          lowercase
      )    ,     (
          lowercase
      )    ,     (
          lowercase
      )    ,     (
          lowercase
      )    ,     (
          lowercase
      )    ,     (
          lowercase
      )    ,     
      )							    =       config_and_inputs
      lowercase							    =       {'input_ids': input_ids, 'token_type_ids': token_type_ids, 'lengths': input_lengths}
      return config, inputs_dict


@require_torch
class        a     (   a_,				a_,				a_,				unittest.TestCase	):
    UpperCAmelCase_ :     List[Any]	     =(
        (
            XLMModel,
            XLMWithLMHeadModel,
            XLMForQuestionAnswering,
            XLMForSequenceClassification,
            XLMForQuestionAnsweringSimple,
            XLMForTokenClassification,
            XLMForMultipleChoice,
        )
        if is_torch_available()
        else ()
    )
    UpperCAmelCase_ :     List[Any]	     =(
        (XLMWithLMHeadModel,) if is_torch_available() else ()
    )  # TODO (PVP): Check other models whether language generation is also applicable
    UpperCAmelCase_ :     str	     =(
        {
            "feature-extraction": XLMModel,
            "fill-mask": XLMWithLMHeadModel,
            "question-answering": XLMForQuestionAnsweringSimple,
            "text-classification": XLMForSequenceClassification,
            "text-generation": XLMWithLMHeadModel,
            "token-classification": XLMForTokenClassification,
            "zero-shot": XLMForSequenceClassification,
        }
        if is_torch_available()
        else {}
    )







    def 			UpperCamelCase_      (			self							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase       ):
      if (
          pipeline_test_casse_name == "QAPipelineTests"
          and tokenizer_name is not None
          and not tokenizer_name.endswith('Fast'       )
      ):
        # `QAPipelineTests` fails for a few models when the slower tokenizer are used.
        # (The slower tokenizers were never used for pipeline tests before the pipeline testing rework)
        # TODO: check (and possibly fix) the `QAPipelineTests` with slower tokenizer
        return True

      return False







    def 			UpperCamelCase_      (			self							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase=False       ):
      lowercase							    =       super()._prepare_for_class(_lowerCamelCase							,		_lowerCamelCase							,		return_labels=_lowerCamelCase       )

      if return_labels:
        if model_class.__name__ == "XLMForQuestionAnswering":
          lowercase							    =       torch.zeros(
              self.model_tester.batch_size							,		dtype=torch.long							,		device=_lowerCamelCase       )
          lowercase							    =       torch.zeros(
              self.model_tester.batch_size							,		dtype=torch.long							,		device=_lowerCamelCase       )

      return inputs_dict







    def 			UpperCamelCase_      (			self       ):
      lowercase							    =       XLMModelTester(self       )
      lowercase							    =       ConfigTester(self							,		config_class=_lowerCamelCase							,		emb_dim=3_7       )







    def 			UpperCamelCase_      (			self       ):
      self.config_tester.run_common_tests()







    def 			UpperCamelCase_      (			self       ):
      lowercase							    =       self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_xlm_model(*_lowerCamelCase       )







    def 			UpperCamelCase_      (			self       ):
      lowercase							    =       self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_xlm_lm_head(*_lowerCamelCase       )







    def 			UpperCamelCase_      (			self       ):
      lowercase							    =       self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_xlm_simple_qa(*_lowerCamelCase       )







    def 			UpperCamelCase_      (			self       ):
      lowercase							    =       self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_xlm_qa(*_lowerCamelCase       )







    def 			UpperCamelCase_      (			self       ):
      lowercase							    =       self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_xlm_sequence_classif(*_lowerCamelCase       )







    def 			UpperCamelCase_      (			self       ):
      lowercase							    =       self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_xlm_token_classif(*_lowerCamelCase       )







    def 			UpperCamelCase_      (			self       ):
      lowercase							    =       self.model_tester.prepare_config_and_inputs()
      self.model_tester.create_and_check_xlm_for_multiple_choice(*_lowerCamelCase       )







    def 			UpperCamelCase_      (			self							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase=False							,		_lowerCamelCase=1       ):
      self.assertIsInstance(_lowerCamelCase							,		_lowerCamelCase       )
      self.assertListEqual(
          [isinstance(_lowerCamelCase							,		_lowerCamelCase       ) for iter_attentions in attentions]							,		[True] * len(_lowerCamelCase       )       )
      self.assertEqual(len(_lowerCamelCase       )							,		(max_length - min_length) * num_beam_groups       )

      for idx, iter_attentions in enumerate(_lowerCamelCase       ):
        # adds PAD dummy token
        lowercase							    =       min_length + idx + 1
        lowercase							    =       min_length + idx + 1

        lowercase							    =       (
            batch_size * num_beam_groups,
            config.num_attention_heads,
            tgt_len,
            src_len,
        )
        # check attn size
        self.assertListEqual(
            [layer_attention.shape for layer_attention in iter_attentions]							,		[expected_shape] * len(_lowerCamelCase       )       )







    def 			UpperCamelCase_      (			self							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase							,		_lowerCamelCase=False							,		_lowerCamelCase=1       ):
      self.assertIsInstance(_lowerCamelCase							,		_lowerCamelCase       )
      self.assertListEqual(
          [isinstance(_lowerCamelCase							,		_lowerCamelCase       ) for iter_hidden_states in hidden_states]							,		[True] * len(_lowerCamelCase       )							,		)
      self.assertEqual(len(_lowerCamelCase       )							,		(max_length - min_length) * num_beam_groups       )

      for idx, iter_hidden_states in enumerate(_lowerCamelCase       ):
        # adds PAD dummy token
        lowercase							    =       min_length + idx + 1
        lowercase							    =       (batch_size * num_beam_groups, seq_len, config.hidden_size)
        # check hidden size
        self.assertListEqual(
            [layer_hidden_states.shape for layer_hidden_states in iter_hidden_states]							,		[expected_shape] * len(_lowerCamelCase       )							,		)
      pass







    @slow
    def 			UpperCamelCase_      (			self       ):
      for model_name in XLM_PRETRAINED_MODEL_ARCHIVE_LIST[:1]:
        lowercase							    =       XLMModel.from_pretrained(_lowerCamelCase       )
        self.assertIsNotNone(_lowerCamelCase       )


@require_torch
class        a     (   unittest.TestCase	):







    @slow
    def 			UpperCamelCase_      (			self       ):
      lowercase							    =       XLMWithLMHeadModel.from_pretrained('xlm-mlm-en-2048'       )
      model.to(_lowerCamelCase       )
      lowercase							    =       torch.tensor([[1_4, 4_4_7]]							,		dtype=torch.long							,		device=_lowerCamelCase       )  # the president
      lowercase							    =       [
          1_4,
          4_4_7,
          1_4,
          4_4_7,
          1_4,
          4_4_7,
          1_4,
          4_4_7,
          1_4,
          4_4_7,
          1_4,
          4_4_7,
          1_4,
          4_4_7,
          1_4,
          4_4_7,
          1_4,
          4_4_7,
          1_4,
          4_4_7,
      ]  # the president the president the president the president the president the president the president the president the president the president
      # TODO(PVP): this and other input_ids I tried for generation give pretty bad results. Not sure why. Model might just not be made for auto-regressive inference
      lowercase							    =       model.generate(_lowerCamelCase							,		do_sample=_lowerCamelCase       )
      self.assertListEqual(output_ids[0].cpu().numpy().tolist()							,		_lowerCamelCase       )










"""simple docstring"""



def 						_SCREAMING_SNAKE_CASE (    __snake_case			:  List[str]		,					__snake_case			:  List[str]    ):





  '''simple docstring'''





  lowercase							    =       ''
  for i in table:
    res += inp[i - 1]
  return res
def 						_SCREAMING_SNAKE_CASE (    __snake_case			:  str    ):





  '''simple docstring'''





  return data[1:] + data[0]
def 						_SCREAMING_SNAKE_CASE (    __snake_case			:  List[str]		,					__snake_case			:  Optional[int]    ):





  '''simple docstring'''





  lowercase							    =       ''
  for i in range(len(__snake_case    )    ):
    if a[i] == b[i]:
      res += "0"
    else:
      res += "1"
  return res
def 						_SCREAMING_SNAKE_CASE (    __snake_case			:  Dict		,					__snake_case			:  Optional[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 						_SCREAMING_SNAKE_CASE (    __snake_case			:  Union[str, Any]		,					__snake_case			:  Union[str, Any]		,					__snake_case			:  Dict		,					__snake_case			:  Union[str, Any]		,					__snake_case			:  Optional[int]    ):





  '''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		:  Dict						=		input('Enter 10 bit key: ')
    _UpperCamelCase		:  int						=		input('Enter 8 bit message: ')

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

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

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

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


