def METHOD_NAME(text):
    """Returns true if text is a valid UTF-8 string, False otherwise."""
    if isinstance(text, UnicodeType):
        return True
    elif isinstance(text, StringType):
        if PY3:
            return True
        try:
            text.decode('utf-8')
            return True
        except UnicodeError:
            return False
    return False