code: def _hosts_by_success(self, hosts=[]):
          
          hosts = hosts if hosts else self.hosts
          return sorted(hosts, key=lambda h: self._host_errors[h])
docs: Order hosts by most successful (least amount of errors) first.
  
          :param hosts: List of hosts.
          :type hosts: list
          :returns: List of hosts sorted by successful connections.
          :rtype: list