code: 
  
  
  
  __lowerCamelCase  				=					{
      """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     UpperCAmelCase__ (							__snake_case							)   -> list[tuple[str, str]]:
    return [alphabet[char] for char in key.upper()]
  
  
  
  
  def     UpperCAmelCase__ (							__snake_case						,				__snake_case							)   -> str:
    _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     UpperCAmelCase__ (							__snake_case						,				__snake_case							)   -> str:
    return encrypt(__snake_case						,				__snake_case							)
  
  
  
  
  def     UpperCAmelCase__ (							__snake_case						,				__snake_case							)   -> tuple[int, int]:
    _A           =    0 if char in table[0] else 1
    _A           =    table[row].index(__snake_case							)
    return row, col
  
  
  
  
  def     UpperCAmelCase__ (							__snake_case						,				__snake_case							)   -> str:
    _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...
      __lowerCamelCase  				=					input("""Enter key: """).strip()
      __lowerCamelCase  				=					input("""Enter text to encrypt: """).strip()
      __lowerCamelCase  				=					encrypt(key, text)
  
      print(f'''Encrypted: {cipher_text}''')
      print(f'''Decrypted with key: {decrypt(key, cipher_text)}''')
style_context: 
  
  
  
  import cva
  import numpy as np
  
  from digital_image_processing.filters.convolve import img_convolve
  from digital_image_processing.filters.sobel_filter import sobel_filter
  
  __lowerCamelCase  				=					1_8_0
  
  
  
  
  def     UpperCAmelCase__ (							__snake_case						,				__snake_case							)   -> Dict:
    _A           =    k_size // 2
    _A    ,   _A           =    np.mgrid[0 - center : k_size - center, 0 - center : k_size - center]
    _A           =    (
        1
        / (2 * np.pi * sigma)
        * np.exp(-(np.square(__snake_case							) + np.square(__snake_case							)) / (2 * np.square(__snake_case							))							)
    )
    return g
  
  
  
  
  def     UpperCAmelCase__ (							__snake_case						,				__snake_case						,				__snake_case							)   -> int:
    _A           =    np.zeros(__snake_case							)
  
    for row in range(1						,				image_shape[0] - 1							):
      for col in range(1						,				image_shape[1] - 1							):
        _A           =    gradient_direction[row, col]
  
        if (
            0 <= direction < PI / 8
            or 15 * PI / 8 <= direction <= 2 * PI
            or 7 * PI / 8 <= direction <= 9 * PI / 8
        ):
          _A           =    sobel_grad[row, col - 1]
          _A           =    sobel_grad[row, col + 1]
          if sobel_grad[row, col] >= w and sobel_grad[row, col] >= e:
            _A           =    sobel_grad[row, col]
  
        elif (
            PI / 8 <= direction < 3 * PI / 8
            or 9 * PI / 8 <= direction < 11 * PI / 8
        ):
          _A           =    sobel_grad[row + 1, col - 1]
          _A           =    sobel_grad[row - 1, col + 1]
          if sobel_grad[row, col] >= sw and sobel_grad[row, col] >= ne:
            _A           =    sobel_grad[row, col]
  
        elif (
            3 * PI / 8 <= direction < 5 * PI / 8
            or 11 * PI / 8 <= direction < 13 * PI / 8
        ):
          _A           =    sobel_grad[row - 1, col]
          _A           =    sobel_grad[row + 1, col]
          if sobel_grad[row, col] >= n and sobel_grad[row, col] >= s:
            _A           =    sobel_grad[row, col]
  
        elif (
            5 * PI / 8 <= direction < 7 * PI / 8
            or 13 * PI / 8 <= direction < 15 * PI / 8
        ):
          _A           =    sobel_grad[row - 1, col - 1]
          _A           =    sobel_grad[row + 1, col + 1]
          if sobel_grad[row, col] >= nw and sobel_grad[row, col] >= se:
            _A           =    sobel_grad[row, col]
  
    return destination
  
  
  
  
  def     UpperCAmelCase__ (							__snake_case						,				__snake_case						,				__snake_case						,				__snake_case						,				__snake_case						,				__snake_case							)   -> Optional[int]:
    for row in range(1						,				image_shape[0] - 1							):
      for col in range(1						,				image_shape[1] - 1							):
        if destination[row, col] >= threshold_high:
          _A           =    strong
        elif destination[row, col] <= threshold_low:
          _A           =    0
        else:
          _A           =    weak
  
  
  
  
  def     UpperCAmelCase__ (							__snake_case						,				__snake_case						,				__snake_case						,				__snake_case							)   -> List[Any]:
    for row in range(1						,				image_shape[0]							):
      for col in range(1						,				image_shape[1]							):
        if destination[row, col] == weak:
          if 255 in (
              destination[row, col + 1],
              destination[row, col - 1],
              destination[row - 1, col],
              destination[row + 1, col],
              destination[row - 1, col - 1],
              destination[row + 1, col - 1],
              destination[row - 1, col + 1],
              destination[row + 1, col + 1],
          ):
            _A           =    strong
          else:
            _A           =    0
  
  
  
  
  def     UpperCAmelCase__ (							__snake_case						,				__snake_case=15						,				__snake_case=30						,				__snake_case=128						,				__snake_case=255							)   -> List[Any]:
    # gaussian_filter
    _A           =    img_convolve(__snake_case						,				gen_gaussian_kernel(9						,				sigma=1.4							)							)
    # get the gradient and degree by sobel_filter
    _A    ,   _A           =    sobel_filter(__snake_case							)
    _A           =    PI + np.radadeg(__snake_case							)
  
    _A           =    suppress_non_maximum(image.shape						,				__snake_case						,				__snake_case							)
  
    detect_high_low_threshold(
        image.shape						,				__snake_case						,				__snake_case						,				__snake_case						,				__snake_case						,				__snake_case							)
  
    track_edge(image.shape						,				__snake_case						,				__snake_case						,				__snake_case							)
  
    return destination
  
  
  if __name__ == "__main__":
      # read original image in gray mode
      __lowerCamelCase  				=					cva.imread(R"""../image_data/lena.jpg""", 0)
      # canny edge detection
      __lowerCamelCase  				=					canny(lena)
      cva.imshow("""canny""", canny_destination)
      cva.waitKey(0)