def   a_					(_lowerCAmelCase  :   str = "mytext.txt"			,	_lowerCAmelCase  :   bool = False       )->				None:
    import socket

    snake_case:						Any         =   12312  # Reserve a port for your service.
    snake_case:						List[Any]         =   socket.socket()  # Create a socket object
    snake_case:						Union[str, 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:
        snake_case    , snake_case:						List[Any]         =   sock.accept()  # Establish connection with client.
        print(F"Got connection from {addr}"       )
        snake_case:						str         =   conn.recv(1024       )
        print(F"Server received: {data = }"       )

        with open(_lowerCAmelCase			,	"""rb"""       ) as in_file:
            snake_case:						Optional[int]         =   in_file.read(1024       )
            while data:
                conn.send(_lowerCAmelCase       )
                print(F"Sent {data!r}"       )
                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()



from __future__ import annotations

from statistics import mean

def   a_					(_lowerCAmelCase  :   list[int]       )->				list[int]:
    snake_case:						Tuple         =   2
    snake_case:						str         =   list(_lowerCAmelCase       )
    snake_case:						Union[str, Any]         =   [0] * len(_lowerCAmelCase       )
    snake_case:						List[Any]         =   0
    while True:
        snake_case:						Optional[int]         =   True
        for i, burst_time in enumerate(_lowerCAmelCase       ):
            if rem_burst_times[i] > 0:
                snake_case:						Dict         =   False
                if rem_burst_times[i] > quantum:
                    t += quantum
                    rem_burst_times[i] -= quantum
                else:
                    t += rem_burst_times[i]
                    snake_case:						Optional[Any]         =   t - burst_time
                    snake_case:						Tuple         =   0
        if done is True:
            return waiting_times

def   a_					(_lowerCAmelCase  :   list[int]			,	_lowerCAmelCase  :   list[int]       )->				list[int]:
    return [burst + waiting for burst, waiting in zip(_lowerCAmelCase			,	_lowerCAmelCase       )]


if __name__ == "__main__":
    __lowerCAmelCase    :  List[Any]										= [3, 5, 7]
    __lowerCAmelCase    :  List[Any]										= calculate_waiting_times(burst_times)
    __lowerCAmelCase    :  str										= calculate_turn_around_times(burst_times, waiting_times)
    print('Process ID \tBurst Time \tWaiting Time \tTurnaround Time')
    for i, burst_time in enumerate(burst_times):
        print(
            F"""  {i + 1}\t\t  {burst_time}\t\t  {waiting_times[i]}\t\t  """
            F"""{turn_around_times[i]}"""
        )
    print(F"""\nAverage waiting time = {mean(waiting_times):.5f}""")
    print(F"""Average turn around time = {mean(turn_around_times):.5f}""")


