<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_bytes(s, encoding="utf-8"):
 """ Converts the string to a bytes type, if not already. :s: the string to convert to bytes :returns: `str` on Python2 and `bytes` on Python3. """

    if isinstance(s, six.binary_type):
        return s
    else:
        return six.text_type(s).encode(encoding)