# Path: onecodex/exceptions.py
# class ValidationError(OneCodexException):
#     pass


import re
from onecodex.exceptions import ValidationError
    elif "boolean" in schema_rules["type"]:
        return validate_boolean(value)
    elif "format" in schema_rules and "date-time" in schema_rules["format"]:
        return validate_datetime(value)
    else:
        return value


def validate_enum(value, schema_rules):
    if value not in schema_rules["enum"]:
        # This is gross, but is necessary for string comparison between Python2 ([u'Illumina HiSeq']) and Python3 (['Illumina Hiseq']). On the plus side, it makes the error message more Human Readable.
        error_array = []
        for rule in schema_rules["enum"]:
            if rule:
                error_array.append(str(rule))
            else:
                error_array.append(rule)
        raise ValidationError(
            "{} is not a valid value for this key. Value must be one of the following options: {}".format(
                value, error_array
            )
        )
    return value


def validate_number(value, schema_rules):
    num_value = value
    try:
        num_value = float(value)
    except ValueError:

# Path: onecodex/exceptions.py
# class ValidationError(OneCodexException):
#     pass


# Path: onecodex/metadata_upload.py
import re
from onecodex.exceptions import ValidationError

    elif "boolean" in schema_rules["type"]:
        return validate_boolean(value)
    elif "format" in schema_rules and "date-time" in schema_rules["format"]:
        return validate_datetime(value)
    else:
        return value


def validate_enum(value, schema_rules):
    if value not in schema_rules["enum"]:
        # This is gross, but is necessary for string comparison between Python2 ([u'Illumina HiSeq']) and Python3 (['Illumina Hiseq']). On the plus side, it makes the error message more Human Readable.
        error_array = []
        for rule in schema_rules["enum"]:
            if rule:
                error_array.append(str(rule))
            else:
                error_array.append(rule)
        raise ValidationError(
            "{} is not a valid value for this key. Value must be one of the following options: {}".format(
                value, error_array
            )
        )
    return value


def validate_number(value, schema_rules):
    num_value = value
    try:
        num_value = float(value)
    except ValueError:

        raise ValidationError("{} must be a number".format(value))