code: def add_or_return_host(self, host):
          
          with self._hosts_lock:
              try:
                  return self._hosts[host.endpoint], False
              except KeyError:
                  self._hosts[host.endpoint] = host
                  return host, True
docs: Returns a tuple (host, new), where ``host`` is a Host
          instance, and ``new`` is a bool indicating whether
          the host was newly added.