

__a						:Optional[int]            = {
    '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	(   __UpperCamelCase  :   Union[str, Any]						):



      """simple docstring"""

      return [alphabet[char] for char in key.upper()]

def 			__snake_case	(   __UpperCamelCase  :   Optional[Any]							,__UpperCamelCase  :   int						):



      """simple docstring"""

      A_	     =							""
      A_	     =							0
      A_	     =							generate_table(__snake_case						)
      for char in words.upper():
            cipher += get_opponent(table[count]							,__snake_case						)
            A_	     =							(count + 1) % len(__snake_case						)
      return cipher

def 			__snake_case	(   __UpperCamelCase  :   List[Any]							,__UpperCamelCase  :   Any						):



      """simple docstring"""

      return encrypt(__snake_case							,__snake_case						)

def 			__snake_case	(   __UpperCamelCase  :   List[Any]							,__UpperCamelCase  :   List[str]						):



      """simple docstring"""

      A_	     =							0 if char in table[0] else 1
      A_	     =							table[row].index(__snake_case						)
      return row, col

def 			__snake_case	(   __UpperCamelCase  :   Any							,__UpperCamelCase  :   List[Any]						):



      """simple docstring"""

      A_     ,    A_	     =							get_position(__snake_case							,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...
      __a						:Tuple            = input('Enter key: ').strip()
      __a						:List[Any]            = input('Enter text to encrypt: ').strip()
      __a						:str            = encrypt(key, text)

      print(F"Encrypted: {cipher_text}")
      print(F"Decrypted with key: {decrypt(key, cipher_text)}")








import json
import os
import tempfile

import datasets
from datasets.arrow_writer import ArrowWriter
from datasets.features import ArrayaD
from utils import generate_examples, get_duration


__a						:Dict            = (30, 487)
__a						:int            = (36, 1024)
__a						:Tuple            = (100, 100)
__a						:Dict            = 100

__a						:List[str]            = datasets.Features(
    {'text': ArrayaD(SHAPE_TEST_1, dtype='float32'), 'image': ArrayaD(SHAPE_TEST_2, dtype='float32')}
)

__a      ,			__a						:str            = os.path.split(__file__)
__a						:Optional[Any]            = os.path.join(RESULTS_BASEPATH, 'results', RESULTS_FILENAME.replace('.py', '.json'))

@get_duration
def 			__snake_case	(   __UpperCamelCase  :   Optional[int]							,__UpperCamelCase  :   Union[str, Any]							,__UpperCamelCase  :   Dict						):



      """simple docstring"""

      with ArrowWriter(features=__UpperCamelCase							,path=os.path.join(__UpperCamelCase							,"beta.arrow"						)						) as writer:
            for key, record in dummy_data:
                  A_	     =							my_features.encode_example(__UpperCamelCase						)
                  writer.write(__UpperCamelCase						)
            A_     ,    A_	     =							writer.finalize()

@get_duration
def 			__snake_case	(   __UpperCamelCase  :   int							,__UpperCamelCase  :   Any						):



      """simple docstring"""

      A_	     =							datasets.Dataset.from_file(
          filename=os.path.join(__UpperCamelCase							,"beta.arrow"						)							,info=datasets.DatasetInfo(features=__UpperCamelCase						)						)
      for _ in dataset:
            pass

@get_duration
def 			__snake_case	(   __UpperCamelCase  :   Optional[Any]							,__UpperCamelCase  :   List[str]						):



      """simple docstring"""

      A_	     =							datasets.Dataset.from_file(
          filename=os.path.join(__UpperCamelCase							,"beta.arrow"						)							,info=datasets.DatasetInfo(features=__UpperCamelCase						)						)
      dataset.set_format("numpy"						)
      for _ in dataset:
            pass

@get_duration
def 			__snake_case	(   __UpperCamelCase  :   List[str]							,__UpperCamelCase  :   Tuple						):



      """simple docstring"""

      A_	     =							10
      A_	     =							datasets.Dataset.from_file(
          filename=os.path.join(__UpperCamelCase							,"beta.arrow"						)							,info=datasets.DatasetInfo(features=__UpperCamelCase						)						)
      for i in range(0							,len(__UpperCamelCase						)							,__UpperCamelCase						):
            A_	     =							dataset[i : i + batch_size]

@get_duration
def 			__snake_case	(   __UpperCamelCase  :   int							,__UpperCamelCase  :   List[Any]						):



      """simple docstring"""

      A_	     =							10
      A_	     =							datasets.Dataset.from_file(
          filename=os.path.join(__UpperCamelCase							,"beta.arrow"						)							,info=datasets.DatasetInfo(features=__UpperCamelCase						)						)
      dataset.set_format("numpy"						)
      for i in range(0							,len(__UpperCamelCase						)							,__UpperCamelCase						):
            A_	     =							dataset[i : i + batch_size]

@get_duration
def 			__snake_case	(   __UpperCamelCase  :   int							,__UpperCamelCase  :   Tuple						):



      """simple docstring"""

      A_	     =							datasets.Dataset.from_file(
          filename=os.path.join(__UpperCamelCase							,"beta.arrow"						)							,info=datasets.DatasetInfo(features=__UpperCamelCase						)						)
      for col in feats:
            A_	     =							dataset[col]

@get_duration
def 			__snake_case	(   __UpperCamelCase  :   Optional[int]							,__UpperCamelCase  :   Optional[Any]						):



      """simple docstring"""

      A_	     =							datasets.Dataset.from_file(
          filename=os.path.join(__UpperCamelCase							,"beta.arrow"						)							,info=datasets.DatasetInfo(features=__UpperCamelCase						)						)
      dataset.set_format("numpy"						)
      for col in feats:
            A_	     =							dataset[col]

def 			__snake_case	(   ):



      """simple docstring"""

      A_	     =							{}
      A_	     =							(
          read_unformated,
          read_formatted_as_numpy,
          read_batch_unformated,
          read_batch_formatted_as_numpy,
          read_col_unformated,
          read_col_formatted_as_numpy,
      )
      with tempfile.TemporaryDirectory() as tmp_dir:
            A_	     =							datasets.Features({"image": ArrayaD(__UpperCamelCase							,dtype="float32"						)}						)
            A_	     =							generate_examples(features=__UpperCamelCase							,num_examples=__UpperCamelCase						)
            A_	     =							write(__UpperCamelCase							,__UpperCamelCase							,__UpperCamelCase						)
            for read_func in read_functions:
                  A_	     =							read_func(__UpperCamelCase							,__UpperCamelCase						)

      with tempfile.TemporaryDirectory() as tmp_dir:
            # don't use fixed length for fair comparison
            # feats = datasets.Features(
            #     {"image": datasets.Sequence(datasets.Sequence(datasets.Value("float32"), SPEED_TEST_SHAPE[1]), SPEED_TEST_SHAPE[0])}
            # )
            A_	     =							datasets.Features({"image": datasets.Sequence(datasets.Sequence(datasets.Value("float32"						)						)						)}						)
            A_	     =							generate_examples(
                features=__UpperCamelCase							,num_examples=__UpperCamelCase							,seq_shapes={"image": SPEED_TEST_SHAPE}						)
            A_	     =							write(__UpperCamelCase							,__UpperCamelCase							,__UpperCamelCase						)
            for read_func in read_functions:
                  A_	     =							read_func(__UpperCamelCase							,__UpperCamelCase						)

      with tempfile.TemporaryDirectory() as tmp_dir:
            # don't use fixed length for fair comparison
            # feats = datasets.Features(
            #     {"image": datasets.Sequence(datasets.Value("float32"), SPEED_TEST_SHAPE[0] * SPEED_TEST_SHAPE[1])}
            # )
            A_	     =							datasets.Features({"image": datasets.Sequence(datasets.Value("float32"						)						)}						)
            A_	     =							generate_examples(
                features=__UpperCamelCase							,num_examples=__UpperCamelCase							,seq_shapes={"image": [SPEED_TEST_SHAPE[0] * SPEED_TEST_SHAPE[1]]}							,)
            A_	     =							write(__UpperCamelCase							,__UpperCamelCase							,__UpperCamelCase						)
            for read_func in read_functions:
                  A_	     =							read_func(__UpperCamelCase							,__UpperCamelCase						)

      with open(__UpperCamelCase							,"wb"						) as f:
            f.write(json.dumps(__UpperCamelCase						).encode("utf-8"						)						)


if __name__ == "__main__":  # useful to run the profiler
      benchmark_array_xd()