






"""simple docstring"""




def 							lowerCAmelCase			(   UpperCamelCase_:				str  ,			UpperCamelCase_:				str       )							->				str:







  '''simple docstring'''







  if not isinstance(UpperCamelCase_  ,			UpperCamelCase_       ):
    raise TypeError("plaintext must be a string"       )
  if not isinstance(UpperCamelCase_  ,			UpperCamelCase_       ):
    raise TypeError("key must be a string"       )

  if not plaintext:
    raise ValueError("plaintext is empty"       )
  if not key:
    raise ValueError("key is empty"       )

  key += plaintext
  _a					      =						plaintext.lower()
  _a					      =						key.lower()
  _a					      =						0
  _a					      =						0
  _a					      =						""
  while plaintext_iterator < len(UpperCamelCase_       ):
    if (
        ord(plaintext[plaintext_iterator]       ) < 97
        or ord(plaintext[plaintext_iterator]       ) > 122
    ):
      ciphertext += plaintext[plaintext_iterator]
      plaintext_iterator += 1
    elif ord(key[key_iterator]       ) < 97 or ord(key[key_iterator]       ) > 122:
      key_iterator += 1
    else:
      ciphertext += chr(
          (
              (ord(plaintext[plaintext_iterator]       ) - 97 + ord(key[key_iterator]       ))
              - 97
          )
          % 26
          + 97       )
      key_iterator += 1
      plaintext_iterator += 1
  return ciphertext






def 							lowerCAmelCase			(   UpperCamelCase_:				str  ,			UpperCamelCase_:				str       )							->				str:







  '''simple docstring'''







  if not isinstance(UpperCamelCase_  ,			UpperCamelCase_       ):
    raise TypeError("ciphertext must be a string"       )
  if not isinstance(UpperCamelCase_  ,			UpperCamelCase_       ):
    raise TypeError("key must be a string"       )

  if not ciphertext:
    raise ValueError("ciphertext is empty"       )
  if not key:
    raise ValueError("key is empty"       )

  _a					      =						key.lower()
  _a					      =						0
  _a					      =						0
  _a					      =						""
  while ciphertext_iterator < len(UpperCamelCase_       ):
    if (
        ord(ciphertext[ciphertext_iterator]       ) < 97
        or ord(ciphertext[ciphertext_iterator]       ) > 122
    ):
      plaintext += ciphertext[ciphertext_iterator]
    else:
      plaintext += chr(
          (ord(ciphertext[ciphertext_iterator]       ) - ord(key[key_iterator]       )) % 26
          + 97       )
      key += chr(
          (ord(ciphertext[ciphertext_iterator]       ) - ord(key[key_iterator]       )) % 26
          + 97       )
      key_iterator += 1
    ciphertext_iterator += 1
  return plaintext


if __name__ == "__main__":
     import doctest

     doctest.testmod()
     UpperCamelCase											=     int(input("""Type 1 to encrypt or 2 to decrypt:"""))
     if operation == 1:
          UpperCamelCase											=     input("""Typeplaintext to be encrypted:\n""")
          UpperCamelCase											=     input("""Type the key:\n""")
          print(encrypt(plaintext, key))
     elif operation == 2:
          UpperCamelCase											=     input("""Type the ciphertext to be decrypted:\n""")
          UpperCamelCase											=     input("""Type the key:\n""")
          print(decrypt(ciphertext, key))
     decrypt("""jsqqs avvwo""", """coffee""")










"""simple docstring"""




from typing import TYPE_CHECKING

from ...utils import (
    OptionalDependencyNotAvailable,
    _LazyModule,
    is_flax_available,
    is_sentencepiece_available,
    is_tf_available,
    is_tokenizers_available,
    is_torch_available,
)


UpperCamelCase											=     {"""configuration_pegasus""": ["""PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP""", """PegasusConfig"""]}

try:
     if not is_sentencepiece_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     UpperCamelCase											=     ["""PegasusTokenizer"""]

try:
     if not is_tokenizers_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     UpperCamelCase											=     ["""PegasusTokenizerFast"""]

try:
     if not is_torch_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     UpperCamelCase											=     [
         """PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST""",
         """PegasusForCausalLM""",
         """PegasusForConditionalGeneration""",
         """PegasusModel""",
         """PegasusPreTrainedModel""",
     ]

try:
     if not is_tf_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     UpperCamelCase											=     [
         """TFPegasusForConditionalGeneration""",
         """TFPegasusModel""",
         """TFPegasusPreTrainedModel""",
     ]

try:
     if not is_flax_available():
          raise OptionalDependencyNotAvailable()
except OptionalDependencyNotAvailable:
     pass
else:
     UpperCamelCase											=     [
         """FlaxPegasusForConditionalGeneration""",
         """FlaxPegasusModel""",
         """FlaxPegasusPreTrainedModel""",
     ]


if TYPE_CHECKING:
     from .configuration_pegasus import PEGASUS_PRETRAINED_CONFIG_ARCHIVE_MAP, PegasusConfig

     try:
          if not is_sentencepiece_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .tokenization_pegasus import PegasusTokenizer

     try:
          if not is_tokenizers_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .tokenization_pegasus_fast import PegasusTokenizerFast

     try:
          if not is_torch_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_pegasus import (
              PEGASUS_PRETRAINED_MODEL_ARCHIVE_LIST,
              PegasusForCausalLM,
              PegasusForConditionalGeneration,
              PegasusModel,
              PegasusPreTrainedModel,
          )

     try:
          if not is_tf_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_tf_pegasus import TFPegasusForConditionalGeneration, TFPegasusModel, TFPegasusPreTrainedModel

     try:
          if not is_flax_available():
               raise OptionalDependencyNotAvailable()
     except OptionalDependencyNotAvailable:
          pass
     else:
          from .modeling_flax_pegasus import (
              FlaxPegasusForConditionalGeneration,
              FlaxPegasusModel,
              FlaxPegasusPreTrainedModel,
          )

else:
     import sys

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


