





from __future__ import annotations

from string import ascii_letters







def 				__UpperCamelCase  (		snake_case    ,	snake_case    ,	snake_case = None     )  ->						Dict:


   '''simple docstring'''







   __A				 =       alphabet or ascii_letters

   # The final result string
   __A				 =       ""

   for character in input_string:
      if character not in alpha:
         # Append without encryption if character is not in the alphabet
         result += character
      else:
         # Get the index of the new key and make sure it isn't too large
         __A				 =       (alpha.index(A_     ) + key) % len(A_     )

         # Append the encoded character to the alphabet
         result += alpha[new_key]

   return result







def 				__UpperCamelCase  (		snake_case    ,	snake_case    ,	snake_case = None     )  ->						Any:


   '''simple docstring'''







   key *= -1

   return encrypt(A_    ,	A_    ,	A_     )







def 				__UpperCamelCase  (		snake_case    ,	snake_case = None     )  ->						str:


   '''simple docstring'''







   __A				 =       alphabet or ascii_letters

   # To store data on all the combinations
   __A				 =       {}

   # Cycle through each combination
   for key in range(1    ,	len(A_     ) + 1     ):
      # Decrypt the message and store the result in the data
      __A				 =       decrypt(A_    ,	A_    ,	A_     )

   return brute_force_data


if __name__ == "__main__":
    while True:
        print(F"""\n{"-" * 1_0}\n Menu\n{"-" * 1_0}""")
        print(*["""1.Encrypt""", """2.Decrypt""", """3.BruteForce""", """4.Quit"""], sep="""\n""")

        # get user input
        _UpperCamelCase   :							int     =	input("""\nWhat would you like to do?: """).strip() or '''4'''

        # run functions based on what the user chose
        if choice not in ("1", "2", "3", "4"):
            print("""Invalid choice, please enter a valid choice""")
        elif choice == "1":
            _UpperCamelCase   :							Tuple     =	input("""Please enter the string to be encrypted: """)
            _UpperCamelCase   :							Optional[int]     =	int(input("""Please enter off-set: """).strip())

            print(encrypt(input_string, key))
        elif choice == "2":
            _UpperCamelCase   :							str     =	input("""Please enter the string to be decrypted: """)
            _UpperCamelCase   :							Union[str, Any]     =	int(input("""Please enter off-set: """).strip())

            print(decrypt(input_string, key))
        elif choice == "3":
            _UpperCamelCase   :							int     =	input("""Please enter the string to be decrypted: """)
            _UpperCamelCase   :							List[Any]     =	brute_force(input_string)

            for key, value in brute_force_data.items():
                print(F"""Key: {key} | Message: {value}""")

        elif choice == "4":
            print("""Goodbye.""")
            break








import unittest

from transformers import load_tool

from .test_tools_common import ToolTesterMixin


_UpperCamelCase   :							str     =	"""
Hugging Face was founded in 2016 by French entrepreneurs Clément Delangue, Julien Chaumond, and Thomas Wolf originally as a company that developed a chatbot app targeted at teenagers.[2] After open-sourcing the model behind the chatbot, the company pivoted to focus on being a platform for machine learning.

In March 2021, Hugging Face raised $40 million in a Series B funding round.[3]

On April 28, 2021, the company launched the BigScience Research Workshop in collaboration with several other research groups to release an open large language model.[4] In 2022, the workshop concluded with the announcement of BLOOM, a multilingual large language model with 176 billion parameters.[5]
"""







class 						_lowerCAmelCase(						unittest.TestCase		,   _a):

  """simple docstring"""







  def 		SCREAMING_SNAKE_CASE__	( self     )-> int:
     __A				 =       load_tool('''summarization'''     )
     self.tool.setup()
     __A				 =       load_tool('''summarization'''  ,    remote=UpperCAmelCase     )

  def 		SCREAMING_SNAKE_CASE__	( self     )-> List[str]:
     __A				 =       self.tool(UpperCAmelCase     )
     self.assertEqual(
         UpperCAmelCase  ,    '''Hugging Face was founded in 2016 by French entrepreneurs Clément Delangue, Julien Chaumond, and Thomas Wolf. In March 2021, Hugging Face raised $40 million in a Series B funding round. On April 28, 2021, the company launched the BigScience Research Workshop in collaboration with several other research groups to release an open large language model. In 2022, the workshop concluded with the announcement of BLOOM.'''  ,    )

  def 		SCREAMING_SNAKE_CASE__	( self     )-> Dict:
     __A				 =       self.remote_tool(UpperCAmelCase     )
     self.assertEqual(
         UpperCAmelCase  ,    '''Hugging Face was founded in 2016 by French entrepreneurs Clément Delangue, Julien Chaumond, and Thomas Wolf. In March 2021, Hugging Face raised $40 million in a Series B funding round. On April 28, 2021, the company launched the BigScience Research Workshop in collaboration with several other research groups to release an open large language model. In 2022, the workshop concluded with the announcement of BLOOM.'''  ,    )

  def 		SCREAMING_SNAKE_CASE__	( self     )-> Union[str, Any]:
     __A				 =       self.tool(text=UpperCAmelCase     )
     self.assertEqual(
         UpperCAmelCase  ,    '''Hugging Face was founded in 2016 by French entrepreneurs Clément Delangue, Julien Chaumond, and Thomas Wolf. In March 2021, Hugging Face raised $40 million in a Series B funding round. On April 28, 2021, the company launched the BigScience Research Workshop in collaboration with several other research groups to release an open large language model. In 2022, the workshop concluded with the announcement of BLOOM.'''  ,    )





  def 		SCREAMING_SNAKE_CASE__	( self     )-> Optional[Any]:
     __A				 =       self.remote_tool(text=UpperCAmelCase     )
     self.assertEqual(
         UpperCAmelCase  ,    '''Hugging Face was founded in 2016 by French entrepreneurs Clément Delangue, Julien Chaumond, and Thomas Wolf. In March 2021, Hugging Face raised $40 million in a Series B funding round. On April 28, 2021, the company launched the BigScience Research Workshop in collaboration with several other research groups to release an open large language model. In 2022, the workshop concluded with the announcement of BLOOM.'''  ,    )

