import six
import math


def __get_target_length(size):
    """
    Figures out the increased size of the string per
    IBM Globalization Design Guideline A3: UI Expansion.

    https://www-01.ibm.com/software/globalization/guidelines/a3.html

    :param size: Current size of the string.
    :returns: The desired increased size.
    """
    target_lengths = {
        six.moves.range(1, 11): 3,
        six.moves.range(11, 21): 2,
        six.moves.range(21, 31): 1.8,
        six.moves.range(31, 51): 1.6,
        six.moves.range(51, 71): 1.4,
    }
    target_length = 0
    if size > 70:
        target_length = int(math.ceil(size * 1.3))
    else:
        for r, v in target_lengths.items():
            if size in r:
                target_length = int(math.ceil(size * v))
    return target_length