Determine case type of string.

    Arguments:
        was_upper {[type]} -- [description]
        words {[type]} -- [description]
        string {[type]} -- [description]

    Returns:
        - upper: All words are upper-case.
        - lower: All words are lower-case.
        - pascal: All words are title-case or upper-case. Note that the
                  stringiable may still have separators.
        - camel: First word is lower-case, the rest are title-case or
                 upper-case. stringiable may still have separators.
        - mixed: Any other mixing of word casing. Never occurs if there are
                 no separators.
        - unknown: stringiable contains no words.

def _determine_case(was_upper, words, string):
    """
    Determine case type of string.

    Arguments:
        was_upper {[type]} -- [description]
        words {[type]} -- [description]
        string {[type]} -- [description]

    Returns:
        - upper: All words are upper-case.
        - lower: All words are lower-case.
        - pascal: All words are title-case or upper-case. Note that the
                  stringiable may still have separators.
        - camel: First word is lower-case, the rest are title-case or
                 upper-case. stringiable may still have separators.
        - mixed: Any other mixing of word casing. Never occurs if there are
                 no separators.
        - unknown: stringiable contains no words.

    """
    case_type = 'unknown'
    if was_upper:
        case_type = 'upper'
    elif string.islower():
        case_type = 'lower'
    elif len(words) > 0:
        camel_case = words[0].islower()
        pascal_case = words[0].istitle() or words[0].isupper()

        if camel_case or pascal_case:
            for word in words[1:]:
                c = word.istitle() or word.isupper()
                camel_case &= c
                pascal_case &= c
                if not c:
                    break

        if camel_case:
            case_type = 'camel'
        elif pascal_case:
            case_type = 'pascal'
        else:
            case_type = 'mixed'

    return case_type