<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _find_address_range(addresses):
 """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. """

    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)