'Ensure we have a valid IPv6 address.
Probably not as exhaustive as it should be.
Args:
ip_str: A string, the IPv6 address.
Returns:
A boolean, True if this is a valid IPv6 address.'

def _is_valid_ip(self, ip_str):

    if (':' not in ip_str):
        return False
    if (ip_str.count('::') > 1):
        return False
    if (':::' in ip_str):
        return False
    if ((ip_str.startswith(':') and (not ip_str.startswith('::'))) or (ip_str.endswith(':') and (not ip_str.endswith('::')))):
        return False
    if (('::' not in ip_str) and (ip_str.count(':') != 7)):
        if (ip_str.count('.') != 3):
            return False
    ip_str = self._explode_shorthand_ip_string(ip_str)
    for hextet in ip_str.split(':'):
        if (hextet.count('.') == 3):
            if (not (ip_str.split(':')[(-1)] == hextet)):
                return False
            try:
                IPv4Network(hextet)
            except IPv4IpValidationError:
                return False
        elif ((int(hextet, 16) < 0) or (int(hextet, 16) > 65535)):
            return False
    return True
