





"""simple docstring"""





import math
def 					__A  ()   ->None:





  """simple docstring"""


  lowerCAmelCase__     :Tuple											=				input('Enter message: '     )
  lowerCAmelCase__     :Tuple											=				int(input(F"Enter key [2-{len(_lowerCAmelCase     ) - 1}]: "     )     )
  lowerCAmelCase__     :Dict											=				input('Encryption/Decryption [e/d]: '     )

  if mode.lower().startswith('e'     ):
    lowerCAmelCase__     :Tuple											=				encrypt_message(_lowerCAmelCase	,  _lowerCAmelCase     )
  elif mode.lower().startswith('d'     ):
    lowerCAmelCase__     :Optional[Any]											=				decrypt_message(_lowerCAmelCase	,  _lowerCAmelCase     )

  # Append pipe symbol (vertical bar) to identify spaces at the end.
  print(F"Output:\n{text + '|'}"     )
def 					__A  (_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )   ->str:





  """simple docstring"""


  lowerCAmelCase__     :Any											=				[""""""] * key
  for col in range(_lowerCAmelCase     ):
    lowerCAmelCase__     :str											=				col
    while pointer < len(_lowerCAmelCase     ):
      cipher_text[col] += message[pointer]
      pointer += key
  return "".join(_lowerCAmelCase     )
def 					__A  (_SCREAMING_SNAKE_CASE	,  _SCREAMING_SNAKE_CASE     )   ->str:





  """simple docstring"""


  lowerCAmelCase__     :List[str]											=				math.ceil(len(_lowerCAmelCase     ) / key     )
  lowerCAmelCase__     :Optional[int]											=				key
  lowerCAmelCase__     :Dict											=				(num_cols * num_rows) - len(_lowerCAmelCase     )
  lowerCAmelCase__     :int											=				[""""""] * num_cols
  lowerCAmelCase__     :str											=				0
  lowerCAmelCase__     :int											=				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)
    ):
      lowerCAmelCase__     :Tuple											=				0
      row += 1

  return "".join(_lowerCAmelCase     )


if __name__ == "__main__":
  import doctest

  doctest.testmod()
  main()





'''simple docstring'''





from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_torch_available,
)


__a  			=						{
    "configuration_gpt_bigcode": ["GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP", "GPTBigCodeConfig"],
}

try:
       if not is_torch_available():
              raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
       pass
else:
       __a  			=						[
           "GPT_BIGCODE_PRETRAINED_MODEL_ARCHIVE_LIST",
           "GPTBigCodeForSequenceClassification",
           "GPTBigCodeForTokenClassification",
           "GPTBigCodeForCausalLM",
           "GPTBigCodeModel",
           "GPTBigCodePreTrainedModel",
       ]

if TYPE_CHECKING:
       from .configuration_gpt_bigcode import GPT_BIGCODE_PRETRAINED_CONFIG_ARCHIVE_MAP, GPTBigCodeConfig

       try:
              if not is_torch_available():
                     raise OptionalDependencyNotAvailable()
       except OptionalDependencyNotAvailable:
              pass
       else:
              from .modeling_gpt_bigcode import (
                  GPT_BIGCODE_PRETRAINED_MODEL_ARCHIVE_LIST,
                  GPTBigCodeForCausalLM,
                  GPTBigCodeForSequenceClassification,
                  GPTBigCodeForTokenClassification,
                  GPTBigCodeModel,
                  GPTBigCodePreTrainedModel,
              )


else:
       import sys

       __a  			=						_LazyModule(__name__, globals()["__file__"], _import_structure, module_spec=__spec__)
