def check_string_is_nonempty(string, string_type='string'):
    """Ensures input is a string of non-zero length"""

    if string is None or \
        (not isinstance(string, str)) or \
        len(string) < 1:
        raise ValueError('name of the {} must not be empty!'
                         ''.format(string_type))

    return string