code: 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')
docs: :returns: The utf-8 byte string equivalent of `text`.