def transform_to_bytes(content: str):
    """
    Transform a string to bytes

    Parameters
    ----------

        - content (str): The string to convert

    Raises
    ------

        ValueError: the string is not valid

    Returns
    -------

        - bytes: the converted string in bytes
    """
    if isinstance(content, bytes):
        return content

    if isinstance(content, str):
        return content.encode(encoding='utf-8')
    else:
        raise ValueError(("In order to transform the object to bytes "
                          "you need to provide a string."))