def ipv6(value,
         allow_empty = False,
         **kwargs):
    """Validate that ``value`` is a valid IP address version 6.

    :param value: The value to validate.

    :param allow_empty: If ``True``, returns :obj:`None <python:None>` if
      ``value`` is empty. If ``False``, raises a
      :class:`EmptyValueError <validator_collection.errors.EmptyValueError>`
      if ``value`` is empty. Defaults to ``False``.
    :type allow_empty: :class:`bool <python:bool>`

    :returns: ``value`` / :obj:`None <python:None>`

    :raises EmptyValueError: if ``value`` is empty and ``allow_empty`` is ``False``
    :raises InvalidIPAddressError: if ``value`` is not a valid IP version 6 address or
      empty with ``allow_empty`` is not set to ``True``

    """
    if not value and allow_empty is False:
        raise errors.EmptyValueError('value (%s) was empty' % value)
    elif not value:
        return None

    if not isinstance(value, str):
        raise errors.InvalidIPAddressError('value (%s) is not a valid ipv6' % value)

    value = value.lower().strip()

    is_valid = IPV6_REGEX.match(value)

    if not is_valid:
        raise errors.InvalidIPAddressError('value (%s) is not a valid ipv6' % value)

    return value
Validate that ``value`` is a valid IP address version 6.

    :param value: The value to validate.

    :param allow_empty: If ``True``, returns :obj:`None <python:None>` if
      ``value`` is empty. If ``False``, raises a
      :class:`EmptyValueError <validator_collection.errors.EmptyValueError>`
      if ``value`` is empty. Defaults to ``False``.
    :type allow_empty: :class:`bool <python:bool>`

    :returns: ``value`` / :obj:`None <python:None>`

    :raises EmptyValueError: if ``value`` is empty and ``allow_empty`` is ``False``
    :raises InvalidIPAddressError: if ``value`` is not a valid IP version 6 address or
      empty with ``allow_empty`` is not set to ``True``