

'''simple docstring'''





from cva import destroyAllWindows, imread, imshow, waitKey






def 				_lowerCAmelCase			(   __magic_name__						:     Any						)				->  Optional[int]:
						# getting number of pixels in the image
						lowercase		,	lowercase :							List[Any]    		=img.shape[0], img.shape[1]

						# converting each pixel's color to its negative
						for i in range(__magic_name__						):
												for j in range(__magic_name__						):
																		lowercase :							str    		=[255, 255, 255] - img[i][j]

						return img


if __name__ == "__main__":
							# read original image
							UpperCamelCase_    						=       imread("""image_data/lena.jpg""", 1)

							# convert to its negative
							UpperCamelCase_    						=       convert_to_negative(img)

							# show result image
							imshow("""negative of original image""", img)
							waitKey(0)
							destroyAllWindows()









__snake_case   							=						{
    '''a''': '''AAAAA''',
    '''b''': '''AAAAB''',
    '''c''': '''AAABA''',
    '''d''': '''AAABB''',
    '''e''': '''AABAA''',
    '''f''': '''AABAB''',
    '''g''': '''AABBA''',
    '''h''': '''AABBB''',
    '''i''': '''ABAAA''',
    '''j''': '''BBBAA''',
    '''k''': '''ABAAB''',
    '''l''': '''ABABA''',
    '''m''': '''ABABB''',
    '''n''': '''ABBAA''',
    '''o''': '''ABBAB''',
    '''p''': '''ABBBA''',
    '''q''': '''ABBBB''',
    '''r''': '''BAAAA''',
    '''s''': '''BAAAB''',
    '''t''': '''BAABA''',
    '''u''': '''BAABB''',
    '''v''': '''BBBAB''',
    '''w''': '''BABAA''',
    '''x''': '''BABAB''',
    '''y''': '''BABBA''',
    '''z''': '''BABBB''',
    ''' ''': ''' ''',
}


__snake_case   							=						{value: key for key, value in encode_dict.items()}






def 		_A		(		_lowercase )					-> str:


     """simple docstring"""


     __UpperCamelCase =			''
     for letter in word.lower():
          if letter.isalpha() or letter == " ":
               encoded += encode_dict[letter]
          else:
               raise Exception('encode() accepts only letters of the alphabet and spaces' )
     return encoded






def 		_A		(		_lowercase )					-> str:


     """simple docstring"""


     if set(_lowercase ) - {"A", "B", " "} != set():
          raise Exception('decode() accepts only \'A\', \'B\' and spaces' )
     __UpperCamelCase =			''
     for word in coded.split():
          while len(_lowercase ) != 0:
               decoded += decode_dict[word[:5]]
               __UpperCamelCase =			word[5:]
          decoded += " "
     return decoded.strip()


if __name__ == "__main__":
    from doctest import testmod

    testmod()


