




from string import ascii_uppercase
def 						lowerCAmelCase_       (	__a	,	__a	,	__a = False	,	__a = ascii_uppercase )       ->			str:





							"""simple docstring"""





							SCREAMING_SNAKE_CASE			: Optional[Any]	     =keyword.upper()
							SCREAMING_SNAKE_CASE			: str	     =plaintext.upper()
							SCREAMING_SNAKE_CASE			: List[Any]	     =set(__a )

							# create a list of unique characters in the keyword - their order matters
							# it determines how we will map plaintext characters to the ciphertext
							SCREAMING_SNAKE_CASE			: str	     =[]
							for char in keyword:
														if char in alphabet_set and char not in unique_chars:
																					unique_chars.append(__a )
    # the number of those unique characters will determine the number of rows
							SCREAMING_SNAKE_CASE			: Dict	     =len(__a )

							# create a shifted version of the alphabet
							SCREAMING_SNAKE_CASE			: int	     =unique_chars + [
							    char for char in alphabet if char not in unique_chars
							]

							# create a modified alphabet by splitting the shifted alphabet into rows
							SCREAMING_SNAKE_CASE			: List[str]	     =[
							    shifted_alphabet[k : k + num_unique_chars_in_keyword]
							    for k in range(0	,	26	,	__a )
							]

							# map the alphabet characters to the modified alphabet characters
							# going 'vertically' through the modified alphabet - consider columns first
							SCREAMING_SNAKE_CASE			: Any	     ={}
							SCREAMING_SNAKE_CASE			: int	     =0
							for column in range(__a ):
														for row in modified_alphabet:
																					# if current row (the last one) is too short, break out of loop
																					if len(__a ) <= column:
																												break

																					# map current letter to letter in modified alphabet
																					SCREAMING_SNAKE_CASE			: List[Any]	     =row[column]
																					letter_index += 1

							if verbose:
														print(__a )
							# create the encrypted text by mapping the plaintext to the modified alphabet
							return "".join(mapping[char] if char in mapping else char for char in plaintext )


if __name__ == "__main__":
			# example use
			print(mixed_keyword("""college""", """UNIVERSITY"""))












def 						lowerCAmelCase_       (	__a = "mytext.txt"	,	__a = False )       ->			None:





							"""simple docstring"""





							import socket

							SCREAMING_SNAKE_CASE			: int	     =12312  # Reserve a port for your service.
							SCREAMING_SNAKE_CASE			: Dict	     =socket.socket()  # Create a socket object
							SCREAMING_SNAKE_CASE			: Any	     =socket.gethostname()  # Get local machine name
							sock.bind((host, port) )  # Bind to the port
							sock.listen(5 )  # Now wait for client connection.

							print('''Server listening....''' )

							while True:
														SCREAMING_SNAKE_CASE     ,							SCREAMING_SNAKE_CASE			: Optional[int]	     =sock.accept()  # Establish connection with client.
														print(f'Got connection from {addr}' )
														SCREAMING_SNAKE_CASE			: List[str]	     =conn.recv(1024 )
														print(f'Server received: {data = }' )

														with open(__a	,	'''rb''' ) as in_file:
																					SCREAMING_SNAKE_CASE			: Dict	     =in_file.read(1024 )
																					while data:
																												conn.send(__a )
																												print(f'Sent {data!r}' )
																												SCREAMING_SNAKE_CASE			: str	     =in_file.read(1024 )

														print('''Done sending''' )
														conn.close()
														if testing:  # Allow the test to complete
																					break

							sock.shutdown(1 )
							sock.close()


if __name__ == "__main__":
							send_file()






