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


import re
from onecodex.exceptions import ValidationError
        )
    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))
    if "minimum" in schema_rules and num_value <= schema_rules["minimum"]:
        raise ValidationError(
            "{} must be larger than the minimum value: {}".format(value, schema_rules["minimum"])
        )
    if "maximum" in schema_rules and num_value >= schema_rules["maximum"]:
        raise ValidationError(
            "{} must be smaller than the maximum value: {}".format(value, schema_rules["maximum"])
        )
    return num_value


def validate_boolean(value):
    if value.lower() in truthy_values():
        return True
    elif value.lower() in falsy_values():
        return False
    else:
        raise ValidationError('{} must be either "true" or "false"'.format(value))



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


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

        )
    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))
    if "minimum" in schema_rules and num_value <= schema_rules["minimum"]:
        raise ValidationError(
            "{} must be larger than the minimum value: {}".format(value, schema_rules["minimum"])
        )
    if "maximum" in schema_rules and num_value >= schema_rules["maximum"]:
        raise ValidationError(
            "{} must be smaller than the maximum value: {}".format(value, schema_rules["maximum"])
        )
    return num_value


def validate_boolean(value):
    if value.lower() in truthy_values():
        return True
    elif value.lower() in falsy_values():
        return False
    else:
        raise ValidationError('{} must be either "true" or "false"'.format(value))



def validate_datetime(value):