def count_unescape(value, sub, escape='\\'):
    """
    Runs the sub string count operation on an escaped string
    so that it takes into account the escaped values avoiding
    them for the count operation.

    :type value: String
    :param value: The base string value to have the number of
    occurrences of a sub string counted.
    :type sub: String
    :param sub: The sub string to be evaluated for occurrences,
    this value should be constrained to strings of single character.
    :type escape: String
    :param escape: The "special" escape character that will allow the
    delimiter to be also present in the choices selection.
    :rtype: int
    :return: The final count of occurrences of the sub string
    taking into account the proper escaping of the string.
    """
    count = 0
    iterator = iter(value)
    for char in iterator:
        if char == escape:
            try:
                next(iterator)
            except StopIteration:
                pass
        elif char == sub:
            count += 1
    return count
