def _check_non_whitespace_string(s):
    """checks s for being a non-space-only or non-empty string.
    Returns:
         s.trim()
    """
    if not isinstance(s, str):
        raise TypeError('unexpected type {}. Must be str.'.format(type(s)))
    _s = s.strip()
    if not _s:
        raise ValueError(_s)
    return _s
