def validate_numeric(type_func, value):
    try:
        return type_func(value)
    except ValueError:
        raise ValidationError("Invalid %s: %s" % (type_func.__name__, value))
dataset/ETHPy150Open dnephin/PyStaticConfiguration/staticconf/validation.py/validate_numeric/original