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






						'''simple docstring'''





						import socket

						UpperCAmelCase    : Optional[Any]      =1_23_12  # Reserve a port for your service.
						UpperCAmelCase    : Optional[Any]      =socket.socket()  # Create a socket object
						UpperCAmelCase    : int      =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:
												UpperCAmelCase    : List[str]      =sock.accept()  # Establish connection with client.
												print(f'''Got connection from {addr}'''						)
												UpperCAmelCase    : str      =conn.recv(10_24						)
												print(f'''Server received: {data = }'''						)

												with open(__lowerCAmelCase		,					'''rb'''						) as in_file:
																		UpperCAmelCase    : Any      =in_file.read(10_24						)
																		while data:
																								conn.send(__lowerCAmelCase						)
																								print(f'''Sent {data!r}'''						)
																								UpperCAmelCase    : List[str]      =in_file.read(10_24						)

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

						sock.shutdown(1						)
						sock.close()


if __name__ == "__main__":
					send_file()

__snake_case			      =    [[0, 1, 1], [0, 0, 1], [1, 0, 0]]







class 			__snake_case   :
 def __init__(  self		,   snake_case__						)	->							Any:
       '''simple docstring'''





       UpperCAmelCase    : List[Any]      =name
       UpperCAmelCase    : Tuple      =[]
       UpperCAmelCase    : str      =[]
 def 	UpperCAmelCase__       (  self		,   snake_case__						)	->							int:
       '''simple docstring'''





       self.inbound.append(snake_case__						)
 def 	UpperCAmelCase__       (  self		,   snake_case__						)	->							Dict:
       '''simple docstring'''





       self.outbound.append(snake_case__						)






 def __repr__(  self						)	->							Union[str, Any]:
       '''simple docstring'''





       return f'''<node={self.name} inbound={self.inbound} outbound={self.outbound}>'''





def   lowerCAmelCase_ (				__lowerCAmelCase		,					__lowerCAmelCase=3		,					__lowerCAmelCase=0.85						)->  Any:






      '''simple docstring'''





      UpperCAmelCase    : List[Any]      ={}
      for node in nodes:
            UpperCAmelCase    : str      =1

      UpperCAmelCase    : str      ={}
      for node in nodes:
            UpperCAmelCase    : int      =len(node.outbound						)

      for i in range(__lowerCAmelCase						):
            print(f'''======= Iteration {i + 1} ======='''						)
            for _, node in enumerate(__lowerCAmelCase						):
                  UpperCAmelCase    : Optional[int]      =(1 - d) + d * sum(
                      ranks[ib] / outbounds[ib] for ib in node.inbound						)
            print(__lowerCAmelCase						)





def   lowerCAmelCase_ (				)->  Union[str, Any]:






      '''simple docstring'''





      UpperCAmelCase    : Union[str, Any]      =list(input('''Enter Names of the Nodes: '''						).split()						)

      UpperCAmelCase    : str      =[Node(__lowerCAmelCase						) for name in names]

      for ri, row in enumerate(__lowerCAmelCase						):
            for ci, col in enumerate(__lowerCAmelCase						):
                  if col == 1:
                        nodes[ci].add_inbound(names[ri]						)
                        nodes[ri].add_outbound(names[ci]						)

      print('''======= Nodes ======='''						)
      for node in nodes:
            print(__lowerCAmelCase						)

      page_rank(__lowerCAmelCase						)


if __name__ == "__main__":
     main()
