networking return self sock def __exit__(self*ignore)self sock close(the address object is -tuple (ip addressport numberand is set when the context manager is created once the context manager is used in with statement it creates socket and tries to make connection--blocking until connection is established or until socket exception is raised the first argument to the socket socket(initializer is the address familyhere we have used socket af_inet (ipv )but others are availablefor examplesocket af_inet (ipv )socket af_unixand socket af_netlink the second argument is normally either socket sock_stream (tcpas we have used hereor socket sock_dgram (udpwhen the flow of control leaves the with statement' scope the context object' __exit__(method is called we don' care whether an exception was raised or not (so we ignore the exception arguments)and just close the socket since the method returns none (in boolean contextfalse)any exceptions are propagated--this works well since we put suitable except block in handle_request(to process any socket exceptions that occur creating tcp server ||since the code for creating servers often follows the same designrather than having to use the low-level socket modulewe can use the high-level socketserver module which takes care of all the housekeeping for us all we have to do is provide request handler class with handle(method which is used to read requests and write replies the socketserver module handles the communications for usservicing each connection requesteither serially or by passing each request to its own separate thread or process--and it does all of this transparently so that we are insulated from the low-level details for this application the server is car_registration_server py this program contains very simple car class that holds seatsmileageand owner information as properties (the first one read-onlythe class does not hold car licenses because the cars are stored in dictionary and the licenses are used for the dictionary' keys we will begin by looking at the main(functionthen briefly review how the server' data is loadedthen the creation of the custom server classand finally the implementation of the request handler class that handles the client requests the first time the server is run on windows firewall dialog might pop up saying that python is blocked--click unblock to allow the server to operate