(value)
Converts bytes to a string value, if necessary.

    Args:
        value (Union[str, bytes]): The value to be converted.

    Returns:
        str: 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.
Converts bytes to a string value, if necessary.
Converts bytes to a string value if necessary .
def from_bytes(value):
    """Converts bytes to a string value, if necessary.

    Args:
        value (Union[str, bytes]): The value to be converted.

    Returns:
        str: 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.
    """
    result = value.decode("utf-8") if isinstance(value, six.binary_type) else value
    if isinstance(result, six.text_type):
        return result
    else:
        raise ValueError("{0!r} could not be converted to unicode".format(value))
def from_bytes ( value ) : result = value . decode ( "utf-8" ) if isinstance ( value , six . binary_type ) else value if isinstance ( result , six . text_type ) : return result else : raise ValueError ( "{0!r} could not be converted to unicode" . format ( value ) )