def to_bytes(x):
    """
    Byte conv
    :param x:
    :return:
    """
    if isinstance(x, bytes):
        return x
    if isinstance(x, basestring):
        return x.encode('utf-8')
def to_bytes ( x ) : if isinstance ( x , bytes ) : return x if isinstance ( x , basestring ) : return x . encode ( 'utf-8' )
Byte conv
    :param x:
    :return: