code: def _get_preferred_host(self, result: ResolveResult) -> Tuple[str, str]:
          '''Get preferred host from DNS results.'''
          host_1 = result.first_ipv4.ip_address if result.first_ipv4 else None
          host_2 = result.first_ipv6.ip_address if result.first_ipv6 else None
  
          if not host_2:
              return host_1, None
          elif not host_1:
              return host_2, None
  
          preferred_host = self._happy_eyeballs_table.get_preferred(
              host_1, host_2)
  
          if preferred_host:
              return preferred_host, None
          else:
              return host_1, host_f _get_preferred_host(self, result: ResolveResult) -> Tuple[str, str]:
          '''Get preferred host from DNS results.'''
          host_1 = result.first_ipv4.ip_address if result.first_ipv4 else None
          host_2 = result.first_ipv6.ip_address if result.first_ipv6 else None
  
          if not host_2:
              return host_1, None
          elif not host_1:
              return host_2, None
  
          preferred_host = self._happy_eyeballs_table.get_preferred(
              host_1, host_2)
  
          if preferred_host:
              return preferred_host, None
          else:
              return host_1, host_2
docs: Get preferred host from DNS results.