def endswith_partial(text, partial_str):
    """Check if the text ends with any partial version of the
    specified string."""
    test_str = partial_str[:-1]
    while test_str:
        if text.endswith(test_str):
            return len(test_str)
        test_str = test_str[:-1]
    return False
