






from typing import Optional, Union

from ...file_utils import TensorType
from ...processing_utils import ProcessorMixin
from ...tokenization_utils_base import BatchEncoding, PaddingStrategy, TruncationStrategy



class  __UpperCAmelCase						(_UpperCAmelCase       ):
			__snake_case							: int							=				"MarkupLMFeatureExtractor"
			__snake_case							: Dict							=				("MarkupLMTokenizer", "MarkupLMTokenizerFast")
			__snake_case							: Any							=				True







			def __call__(      self:    Dict ,      UpperCAmelCase_:    Dict=None ,      UpperCAmelCase_:    Optional[int]=None ,      UpperCAmelCase_:    str=None ,      UpperCAmelCase_:    str=None ,      UpperCAmelCase_:    Optional[int]=None ,      UpperCAmelCase_:    bool = True ,      UpperCAmelCase_:    Union[bool, str, PaddingStrategy] = False ,      UpperCAmelCase_:    Union[bool, str, TruncationStrategy] = None ,      UpperCAmelCase_:    Optional[int] = None ,      UpperCAmelCase_:    int = 0 ,      UpperCAmelCase_:    Optional[int] = None ,      UpperCAmelCase_:    Optional[bool] = None ,      UpperCAmelCase_:    Optional[bool] = None ,      UpperCAmelCase_:    bool = False ,      UpperCAmelCase_:    bool = False ,      UpperCAmelCase_:    bool = False ,      UpperCAmelCase_:    bool = False ,      UpperCAmelCase_:    bool = True ,      UpperCAmelCase_:    Optional[Union[str, TensorType]] = None ,      **UpperCAmelCase_:    List[Any] ,      ):







									'''simple docstring'''




									if self.parse_html:
															if html_strings is None:
																					raise ValueError("""Make sure to pass HTML strings in case `parse_html` is set to `True`"""	)

															if nodes is not None or xpaths is not None or node_labels is not None:
																					raise ValueError(
																					    """Please don't pass nodes, xpaths nor node labels in case `parse_html` is set to `True`"""	)

															_SCREAMING_SNAKE_CASE       =    self.feature_extractor(UpperCAmelCase_	)
															_SCREAMING_SNAKE_CASE       =    features["""nodes"""]
															_SCREAMING_SNAKE_CASE       =    features["""xpaths"""]
									else:
															if html_strings is not None:
																					raise ValueError("""You have passed HTML strings but `parse_html` is set to `False`."""	)
															if nodes is None or xpaths is None:
																					raise ValueError("""Make sure to pass nodes and xpaths in case `parse_html` is set to `False`"""	)

        # # second, apply the tokenizer
									if questions is not None and self.parse_html:
															if isinstance(UpperCAmelCase_ ,      UpperCAmelCase_	):
																					_SCREAMING_SNAKE_CASE       =    [questions]  # add batch dimension (as the feature extractor always adds a batch dimension)

									_SCREAMING_SNAKE_CASE       =    self.tokenizer(
									    text=questions if questions is not None else nodes ,      text_pair=nodes if questions is not None else None ,      xpaths=UpperCAmelCase_ ,      node_labels=UpperCAmelCase_ ,      add_special_tokens=UpperCAmelCase_ ,      padding=UpperCAmelCase_ ,      truncation=UpperCAmelCase_ ,      max_length=UpperCAmelCase_ ,      stride=UpperCAmelCase_ ,      pad_to_multiple_of=UpperCAmelCase_ ,      return_token_type_ids=UpperCAmelCase_ ,      return_attention_mask=UpperCAmelCase_ ,      return_overflowing_tokens=UpperCAmelCase_ ,      return_special_tokens_mask=UpperCAmelCase_ ,      return_offsets_mapping=UpperCAmelCase_ ,      return_length=UpperCAmelCase_ ,      verbose=UpperCAmelCase_ ,      return_tensors=UpperCAmelCase_ ,      **UpperCAmelCase_ ,      )

									return encoded_inputs







			def 				UpperCamelCase (      self:    Dict ,      *UpperCAmelCase_:    Any ,      **UpperCAmelCase_:    Dict	):







									'''simple docstring'''




									return self.tokenizer.batch_decode(*UpperCAmelCase_ ,      **UpperCAmelCase_	)







			def 				UpperCamelCase (      self:    Union[str, Any] ,      *UpperCAmelCase_:    Any ,      **UpperCAmelCase_:    Dict	):







									'''simple docstring'''




									return self.tokenizer.decode(*UpperCAmelCase_ ,      **UpperCAmelCase_	)







			@property
			def 				UpperCamelCase (      self:    Any	):







									'''simple docstring'''




									_SCREAMING_SNAKE_CASE       =    self.tokenizer.model_input_names
									return tokenizer_input_names









from __future__ import annotations

from string import ascii_letters

def 			__lowerCamelCase     (						snake_case__			,snake_case__			,snake_case__ = None						)				->    str:






						"""simple docstring"""





						_SCREAMING_SNAKE_CASE       =    alphabet or ascii_letters

						# The final result string
						_SCREAMING_SNAKE_CASE       =    """"""

						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
																		_SCREAMING_SNAKE_CASE       =    (alpha.index(snake_case__						) + key) % len(snake_case__						)

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

						return result

def 			__lowerCamelCase     (						snake_case__			,snake_case__			,snake_case__ = None						)				->    str:






						"""simple docstring"""





						key *= -1

						return encrypt(snake_case__			,snake_case__			,snake_case__						)

def 			__lowerCamelCase     (						snake_case__			,snake_case__ = None						)				->    dict[int, str]:






						"""simple docstring"""





						_SCREAMING_SNAKE_CASE       =    alphabet or ascii_letters

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

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

						return brute_force_data


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

				# get user input
				UpperCamelCase												=      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												=      input('''Please enter the string to be encrypted: ''')
						UpperCamelCase												=      int(input('''Please enter off-set: ''').strip())

						print(encrypt(input_string, key))
				elif choice == "2":
						UpperCamelCase												=      input('''Please enter the string to be decrypted: ''')
						UpperCamelCase												=      int(input('''Please enter off-set: ''').strip())

						print(decrypt(input_string, key))
				elif choice == "3":
						UpperCamelCase												=      input('''Please enter the string to be decrypted: ''')
						UpperCamelCase												=      brute_force(input_string)

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

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

