# Path: ipuz/exceptions.py
# class IPUZException(Exception):
#     pass


from datetime import datetime
from ipuz.exceptions import IPUZException
    from ipuz.structures import validate_stylespec
import re
    if not groups:
        return None
    return int(groups.group(1))


def get_kind_version_number(field_data):
    groups = re.match("http://ipuz.org/[a-z]*#([1-9]*)", field_data)
    if not groups:
        return 1  # default value
    return int(groups.group(1))


def validate_bool(field_name, field_data):
    if not isinstance(field_data, bool):
        raise IPUZException("Invalid {} value found".format(field_name))


def validate_int(field_name, field_data):
    # type instead of isinstance as bool inherits from int
    if type(field_data) is not int:
        raise IPUZException("Invalid {} value found".format(field_name))


def validate_non_negative_int(field_name, field_data):
    validate_int(field_name, field_data)
    if field_data < 0:
        raise IPUZException("Invalid {} value found".format(field_name))


def validate_string(field_name, field_data):

# Path: ipuz/exceptions.py
# class IPUZException(Exception):
#     pass


# Path: ipuz/validators.py
from datetime import datetime
from ipuz.exceptions import IPUZException
    from ipuz.structures import validate_stylespec
import re

    if not groups:
        return None
    return int(groups.group(1))


def get_kind_version_number(field_data):
    groups = re.match("http://ipuz.org/[a-z]*#([1-9]*)", field_data)
    if not groups:
        return 1  # default value
    return int(groups.group(1))


def validate_bool(field_name, field_data):
    if not isinstance(field_data, bool):
        raise IPUZException("Invalid {} value found".format(field_name))


def validate_int(field_name, field_data):
    # type instead of isinstance as bool inherits from int
    if type(field_data) is not int:
        raise IPUZException("Invalid {} value found".format(field_name))


def validate_non_negative_int(field_name, field_data):
    validate_int(field_name, field_data)
    if field_data < 0:
        raise IPUZException("Invalid {} value found".format(field_name))


def validate_string(field_name, field_data):

    if not isinstance(field_data, str):