code: def encode(input, encoding=UTF8, errors='strict'):
      
      return _get_encoding(encoding).codec_info.encode(input, errors)[0]
docs: Encode a single string.
  
      :param input: An Unicode string.
      :param encoding: An :class:`Encoding` object or a label string.
      :param errors: Type of error handling. See :func:`codecs.register`.
      :raises: :exc:`~exceptions.LookupError` for an unknown encoding label.
      :return: A byte string.