def validate_int_or_percentage(value):
    """Check if value is either a positive integer (less than 9999) or
    a percetage.

    :param value: number to be validated
    :type value: string
    :returns: True if value is valid
    :rtype: bool
    """
    try:
        return 0 < int(value) <= 9999
    except ValueError:
        if value.endswith('%'):
            try:
                return 0 < int(value[:-1]) <= 100
            except ValueError:
                return False
        return False
