code: 
  import sys
  from collections.abc import Mapping
  
  import numpy as np
  import pyarrow as pa
  
  from .. import config
  from ..utils.py_utils import map_nested
  from .formatting import TensorFormatter
  
  
  
  
  
  class      UpperCamelCase_			(			TensorFormatter[Mapping, np.ndarray, Mapping]		):
  
  
  
  
  
  
  
  						'''simple docstring'''
  
  
  
  						def __init__( self       :int		,						lowerCAmelCase__       :Any=None		,						**lowerCAmelCase__       :Union[str, Any]    )     ->int:
  										super().__init__(features=lowerCAmelCase__    )
  										lowercase						    =			np_array_kwargs
  
  
  
  
  
  						def 					SCREAMING_SNAKE_CASE( self       :Union[str, Any]		,						lowerCAmelCase__       :str    )     ->Optional[Any]:
  										if isinstance(lowerCAmelCase__		,						lowerCAmelCase__    ):
  														if column and all(
  														    isinstance(lowerCAmelCase__		,						np.ndarray    ) and x.shape == column[0].shape and x.dtype == column[0].dtype for x in column    ):
  																		return np.stack(lowerCAmelCase__    )
  														else:
  																		# don't use np.array(column, dtype=object)
  																		# since it fails in certain cases
  																		# see https://stackoverflow.com/q/51005699
  																		lowercase						    =			np.empty(len(lowerCAmelCase__    )		,						dtype=lowerCAmelCase__    )
  																		lowercase						    =			column
  																		return out
  										return column
  
  
  
  
  
  						def 					SCREAMING_SNAKE_CASE( self       :str		,						lowerCAmelCase__       :List[str]    )     ->Union[str, Any]:
  										if isinstance(lowerCAmelCase__		,						(str, bytes, type(lowerCAmelCase__    ))    ):
  														return value
  										elif isinstance(lowerCAmelCase__		,						(np.character, np.ndarray)    ) and np.issubdtype(value.dtype		,						np.character    ):
  														return value
  										elif isinstance(lowerCAmelCase__		,						np.number    ):
  														return value
  
  										lowercase						    =			{}
  
  										if isinstance(lowerCAmelCase__		,						np.ndarray    ) and np.issubdtype(value.dtype		,						np.integer    ):
  														lowercase						    =			{"dtype": np.intaa}
  										elif isinstance(lowerCAmelCase__		,						np.ndarray    ) and np.issubdtype(value.dtype		,						np.floating    ):
  														lowercase						    =			{"dtype": np.floataa}
  										elif config.PIL_AVAILABLE and "PIL" in sys.modules:
  														import PIL.Image
  
  														if isinstance(lowerCAmelCase__		,						PIL.Image.Image    ):
  																		return np.asarray(lowerCAmelCase__		,						**self.np_array_kwargs    )
  
  										return np.asarray(lowerCAmelCase__		,						**{**default_dtype, **self.np_array_kwargs}    )
  
  
  
  
  
  						def 					SCREAMING_SNAKE_CASE( self       :int		,						lowerCAmelCase__       :Dict    )     ->int:
  										# support for torch, tf, jax etc.
  										if config.TORCH_AVAILABLE and "torch" in sys.modules:
  														import torch
  
  														if isinstance(lowerCAmelCase__		,						torch.Tensor    ):
  																		return self._tensorize(data_struct.detach().cpu().numpy()[()]    )
  										if hasattr(lowerCAmelCase__		,						"__array__"    ) and not isinstance(lowerCAmelCase__		,						(np.ndarray, np.character, np.number)    ):
  														lowercase						    =			data_struct.__array__()
  										# support for nested types like struct of list of struct
  										if isinstance(lowerCAmelCase__		,						np.ndarray    ):
  														if data_struct.dtype == object:
  																		return self._consolidate([self.recursive_tensorize(lowerCAmelCase__    ) for substruct in data_struct]    )
  										if isinstance(lowerCAmelCase__		,						(list, tuple)    ):
  														return self._consolidate([self.recursive_tensorize(lowerCAmelCase__    ) for substruct in data_struct]    )
  										return self._tensorize(lowerCAmelCase__    )
  
  
  
  
  
  						def 					SCREAMING_SNAKE_CASE( self       :int		,						lowerCAmelCase__       :dict    )     ->str:
  										return map_nested(self._recursive_tensorize		,						lowerCAmelCase__		,						map_list=lowerCAmelCase__    )
  
  
  
  
  
  						def 					SCREAMING_SNAKE_CASE( self       :Tuple		,						lowerCAmelCase__       :pa.Table    )     ->Mapping:
  										lowercase						    =			self.numpy_arrow_extractor().extract_row(lowerCAmelCase__    )
  										lowercase						    =			self.python_features_decoder.decode_row(lowerCAmelCase__    )
  										return self.recursive_tensorize(lowerCAmelCase__    )
  
  
  
  
  
  						def 					SCREAMING_SNAKE_CASE( self       :str		,						lowerCAmelCase__       :pa.Table    )     ->np.ndarray:
  										lowercase						    =			self.numpy_arrow_extractor().extract_column(lowerCAmelCase__    )
  										lowercase						    =			self.python_features_decoder.decode_column(lowerCAmelCase__		,						pa_table.column_names[0]    )
  										lowercase						    =			self.recursive_tensorize(lowerCAmelCase__    )
  										lowercase						    =			self._consolidate(lowerCAmelCase__    )
  										return column
  
  
  
  
  
  						def 					SCREAMING_SNAKE_CASE( self       :List[Any]		,						lowerCAmelCase__       :pa.Table    )     ->Mapping:
  										lowercase						    =			self.numpy_arrow_extractor().extract_batch(lowerCAmelCase__    )
  										lowercase						    =			self.python_features_decoder.decode_batch(lowerCAmelCase__    )
  										lowercase						    =			self.recursive_tensorize(lowerCAmelCase__    )
  										for column_name in batch:
  														lowercase						    =			self._consolidate(batch[column_name]    )
  										return batch
  
style_context: 
  _snake_case			:       List[Any]      =						{
      "A": ("ABCDEFGHIJKLM", "NOPQRSTUVWXYZ"),
      "B": ("ABCDEFGHIJKLM", "NOPQRSTUVWXYZ"),
      "C": ("ABCDEFGHIJKLM", "ZNOPQRSTUVWXY"),
      "D": ("ABCDEFGHIJKLM", "ZNOPQRSTUVWXY"),
      "E": ("ABCDEFGHIJKLM", "YZNOPQRSTUVWX"),
      "F": ("ABCDEFGHIJKLM", "YZNOPQRSTUVWX"),
      "G": ("ABCDEFGHIJKLM", "XYZNOPQRSTUVW"),
      "H": ("ABCDEFGHIJKLM", "XYZNOPQRSTUVW"),
      "I": ("ABCDEFGHIJKLM", "WXYZNOPQRSTUV"),
      "J": ("ABCDEFGHIJKLM", "WXYZNOPQRSTUV"),
      "K": ("ABCDEFGHIJKLM", "VWXYZNOPQRSTU"),
      "L": ("ABCDEFGHIJKLM", "VWXYZNOPQRSTU"),
      "M": ("ABCDEFGHIJKLM", "UVWXYZNOPQRST"),
      "N": ("ABCDEFGHIJKLM", "UVWXYZNOPQRST"),
      "O": ("ABCDEFGHIJKLM", "TUVWXYZNOPQRS"),
      "P": ("ABCDEFGHIJKLM", "TUVWXYZNOPQRS"),
      "Q": ("ABCDEFGHIJKLM", "STUVWXYZNOPQR"),
      "R": ("ABCDEFGHIJKLM", "STUVWXYZNOPQR"),
      "S": ("ABCDEFGHIJKLM", "RSTUVWXYZNOPQ"),
      "T": ("ABCDEFGHIJKLM", "RSTUVWXYZNOPQ"),
      "U": ("ABCDEFGHIJKLM", "QRSTUVWXYZNOP"),
      "V": ("ABCDEFGHIJKLM", "QRSTUVWXYZNOP"),
      "W": ("ABCDEFGHIJKLM", "PQRSTUVWXYZNO"),
      "X": ("ABCDEFGHIJKLM", "PQRSTUVWXYZNO"),
      "Y": ("ABCDEFGHIJKLM", "OPQRSTUVWXYZN"),
      "Z": ("ABCDEFGHIJKLM", "OPQRSTUVWXYZN"),
  }
  
  def    __snake_case       (  __magic_name__	):
  
  
  
  
  
  
  
  				'''simple docstring'''
  
  
  				return [alphabet[char] for char in key.upper()]
  
  def    __snake_case       (  __magic_name__		,						__magic_name__	):
  
  
  
  
  
  
  
  				'''simple docstring'''
  
  
  				lowercase						    =			""
  				lowercase						    =			0
  				lowercase						    =			generate_table(__magic_name__	)
  				for char in words.upper():
  								cipher += get_opponent(table[count]		,						__magic_name__	)
  								lowercase						    =			(count + 1) % len(__magic_name__	)
  				return cipher
  
  def    __snake_case       (  __magic_name__		,						__magic_name__	):
  
  
  
  
  
  
  
  				'''simple docstring'''
  
  
  				return encrypt(__magic_name__		,						__magic_name__	)
  
  def    __snake_case       (  __magic_name__		,						__magic_name__	):
  
  
  
  
  
  
  
  				'''simple docstring'''
  
  
  				lowercase						    =			0 if char in table[0] else 1
  				lowercase						    =			table[row].index(__magic_name__	)
  				return row, col
  
  def    __snake_case       (  __magic_name__		,						__magic_name__	):
  
  
  
  
  
  
  
  				'''simple docstring'''
  
  
  				lowercase    ,  lowercase						    =			get_position(__magic_name__		,						char.upper()	)
  				if row == 1:
  								return table[0][col]
  				else:
  								return table[1][col] if row == 0 else char
  
  
  if __name__ == "__main__":
  						import doctest
  
  						doctest.testmod()  # Fist ensure that all our tests are passing...
  						_snake_case			:       List[Any]      =						input("Enter key: ").strip()
  						_snake_case			:       Optional[int]      =						input("Enter text to encrypt: ").strip()
  						_snake_case			:       Optional[Any]      =						encrypt(key, text)
  
  						print(F"Encrypted: {cipher_text}")
  						print(F"Decrypted with key: {decrypt(key, cipher_text)}")
  