code: def _find_address_range(addresses):
      
      first = last = addresses[0]
      last_index = 0
      for ip in addresses[1:]:
          if ip._ip == last._ip + 1:
              last = ip
              last_index += 1
          else:
              break
      return (first, last, last_index)
docs: Find a sequence of addresses.
  
      Args:
          addresses: a list of IPv4 or IPv6 addresses.
  
      Returns:
          A tuple containing the first and last IP addresses in the sequence,
          and the index of the last IP address in the sequence.