




"""simple docstring"""


from __future__ import annotations






class       lowercase:







 '''simple docstring'''





 def __init__(       self:	Optional[int],   a_:	int = 0	):




   '''simple docstring'''



   _snake_case							:	str			=						key


 def 				UpperCamelCase_     (       self:	Tuple,   a_:	str,   a_:	int	):




   '''simple docstring'''



   assert isinstance(a_,   a_	) and isinstance(a_,   a_	)

   _snake_case							:	Optional[Any]			=						key or self.__key or 1

   # make sure key is an appropriate size
   key %= 255

   return [chr(ord(a_	) ^ key	) for ch in content]


 def 				UpperCamelCase_     (       self:	Union[str, Any],   a_:	str,   a_:	int	):




   '''simple docstring'''



   assert isinstance(a_,   a_	) and isinstance(a_,   a_	)

   _snake_case							:	Dict			=						key or self.__key or 1

   # make sure key is an appropriate size
   key %= 255

   return [chr(ord(a_	) ^ key	) for ch in content]


 def 				UpperCamelCase_     (       self:	Optional[int],   a_:	str,   a_:	int = 0	):




   '''simple docstring'''



   assert isinstance(a_,   a_	) and isinstance(a_,   a_	)

   _snake_case							:	List[Any]			=						key or self.__key or 1

   # make sure key can be any size
   while key > 255:
     key -= 255

   # This will be returned
   _snake_case							:	List[str]			=						""""""

   for ch in content:
     ans += chr(ord(a_	) ^ key	)

   return ans


 def 				UpperCamelCase_     (       self:	Optional[int],   a_:	str,   a_:	int = 0	):




   '''simple docstring'''



   assert isinstance(a_,   a_	) and isinstance(a_,   a_	)

   _snake_case							:	Any			=						key or self.__key or 1

   # make sure key can be any size
   while key > 255:
     key -= 255

   # This will be returned
   _snake_case							:	str			=						""""""

   for ch in content:
     ans += chr(ord(a_	) ^ key	)

   return ans


 def 				UpperCamelCase_     (       self:	Dict,   a_:	str,   a_:	int = 0	):




   '''simple docstring'''



   assert isinstance(a_,   a_	) and isinstance(a_,   a_	)

   try:
     with open(a_	) as fin, open("""encrypt.out""",   """w+"""	) as fout:
       # actual encrypt-process
       for line in fin:
         fout.write(self.encrypt_string(a_,   a_	)	)

   except OSError:
     return False

   return True


 def 				UpperCamelCase_     (       self:	Union[str, Any],   a_:	str,   a_:	int	):




   '''simple docstring'''



   assert isinstance(a_,   a_	) and isinstance(a_,   a_	)

   try:
     with open(a_	) as fin, open("""decrypt.out""",   """w+"""	) as fout:
       # actual encrypt-process
       for line in fin:
         fout.write(self.decrypt_string(a_,   a_	)	)

   except OSError:
     return False

   return True


# Tests
# crypt = XORCipher()
# key = 67

# # test encrypt
# print(crypt.encrypt("hallo welt",key))
# # test decrypt
# print(crypt.decrypt(crypt.encrypt("hallo welt",key), key))

# # test encrypt_string
# print(crypt.encrypt_string("hallo welt",key))

# # test decrypt_string
# print(crypt.decrypt_string(crypt.encrypt_string("hallo welt",key),key))

# if (crypt.encrypt_file("test.txt",key)):
#       print("encrypt successful")
# else:
#       print("encrypt unsuccessful")

# if (crypt.decrypt_file("encrypt.out",key)):
#       print("decrypt successful")
# else:
#       print("decrypt unsuccessful")








"""simple docstring"""


from typing import Any


def       UpperCAmelCase__ (snake_case__							:      list					):
  """simple docstring"""

  if not input_list:
    return []
  _snake_case							:	List[Any]			=						[input_list.count(snake_case__					) for value in input_list]
  _snake_case							:	Optional[int]			=						max(snake_case__					)  # Gets the maximum count in the input list.
  # Gets values of modes
  return sorted({input_list[i] for i, value in enumerate(snake_case__					) if value == y}					)


if __name__ == "__main__":
     import doctest

     doctest.testmod()


