





"""simple docstring"""




import math





def 						UpperCAmelCase__		(     ):






  """simple docstring"""





  A_  :       List[str]										=  input('Enter message: '					)
  A_  :       str										=  int(input(f"""Enter key [2-{len(_UpperCAmelCase					) - 1}]: """					)					)
  A_  :       Optional[int]										=  input('Encryption/Decryption [e/d]: '					)

  if mode.lower().startswith('e'					):
    A_  :       Any										=  encrypt_message(_UpperCAmelCase ,					_UpperCAmelCase					)
  elif mode.lower().startswith('d'					):
    A_  :       int										=  decrypt_message(_UpperCAmelCase ,					_UpperCAmelCase					)

  # Append pipe symbol (vertical bar) to identify spaces at the end.
  print(f"""Output:\n{text + "|"}"""					)





def 						UpperCAmelCase__		(     _UpperCAmelCase ,					_UpperCAmelCase					):






  """simple docstring"""





  A_  :       List[str]										=  [''] * key
  for col in range(_UpperCAmelCase					):
    A_  :       Optional[Any]										=  col
    while pointer < len(_UpperCAmelCase					):
      cipher_text[col] += message[pointer]
      pointer += key
  return "".join(_UpperCAmelCase					)





def 						UpperCAmelCase__		(     _UpperCAmelCase ,					_UpperCAmelCase					):






  """simple docstring"""





  A_  :       str										=  math.ceil(len(_UpperCAmelCase					) / key					)
  A_  :       Optional[Any]										=  key
  A_  :       Any										=  (num_cols * num_rows) - len(_UpperCAmelCase					)
  A_  :       Any										=  [''] * num_cols
  A_  :       Dict										=  0
  A_  :       str										=  0

  for symbol in message:
    plain_text[col] += symbol
    col += 1

    if (
        (col == num_cols)
        or (col == num_cols - 1)
        and (row >= num_rows - num_shaded_boxes)
    ):
      A_  :       str										=  0
      row += 1

  return "".join(_UpperCAmelCase					)


if __name__ == "__main__":
   import doctest

   doctest.testmod()
   main()






"""simple docstring"""




from transformers import BertTokenizerFast

from .custom_tokenization import CustomTokenizer

class  _UpperCAmelCase  (   UpperCAmelCase__		):



      '''simple docstring'''
      lowercase_      : List[str]	    =   CustomTokenizer
      pass