def _from_bytes(value):
result = (value.decode('<STR_LIT:utf-8>')<EOL>if isinstance(value, six.binary_type) else value)<EOL>if isinstance(result, six.text_type):<EOL><INDENT>return result<EOL><DEDENT>else:<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'.format(value))<EOL><DEDENT>
Converts bytes to a string value, if necessary.

    Args:
        value: The string/bytes value to be converted.

    Returns:
        The original value converted to unicode (if bytes) or as passed in
        if it started out as unicode.

    Raises:
        ValueError if the value could not be converted to unicode.