code: def close_socket(self):
          
          try:
              self.docker_py_sock._sock.close()  # pylint: disable=protected-access
          except AttributeError:
              pass
          self.docker_py_sock.close()
docs: Correctly closes the socket
          :return: