Splits a "%s:%d" string and returns the string and number.

    :return: A ``(string, int)`` pair extracted from ``x``.

    :raise ValueError: the string ``x`` does not respect the input format.

def parse_scale(x):
    """Splits a "%s:%d" string and returns the string and number.

    :return: A ``(string, int)`` pair extracted from ``x``.

    :raise ValueError: the string ``x`` does not respect the input format.
    """
    match = re.match(r'^(.+?):(\d+)$', x)
    if not match:
        raise ValueError('Invalid scale "%s".' % x)
    return match.group(1), int(match.group(2))