def ipv6_address(addr):
 if (not isinstance(addr, basestring)):
  raise CX('Invalid input, addr must be a string')
 else:
  addr = addr.strip()
 if (addr == ''):
  return addr
 if (not netaddr.valid_ipv6(addr)):
  raise CX(('Invalid IPv6 address format (%s)' % addr))
 return addr

def ipv6_address ( addr ) : if ( not isinstance ( addr , basestring ) ) : raise CX ( 'Invalid input, addr must be a string' ) else : addr = addr . strip ( ) if ( addr == '' ) : return addr if ( not netaddr . valid_ipv6 ( addr ) ) : raise CX ( ( 'Invalid IPv6 address format (%s)' % addr ) ) return addr
validate an ipv6 address .