def _encode_bytes(self, text):
        """
        :returns: The utf-8 byte string equivalent of `text`.
        """
        if isinstance(text, six.binary_type):
            return text
        if not isinstance(text, six.text_type):
            text = six.text_type(text or '')
        return text.encode('utf-8')
def _encode_bytes ( self , text ) : if isinstance ( text , six . binary_type ) : return text if not isinstance ( text , six . text_type ) : text = six . text_type ( text or '' ) return text . encode ( 'utf-8' )
:returns: The utf-8 byte string equivalent of `text`.