docs: def encode(content, error=None, version=None, mode=None, mask=None,
             encoding=None, eci=False, micro=None, boost_error=True):
      """\
      Creates a (Micro) QR Code.
  
      See :py:func:`segno.make` for a detailed description of the parameters.
  
      Contrary to ``make`` this function returns a named tuple:
      ``(matrix, version, error, mask, segments)``
  
      Note that ``version`` is always an integer referring
      to the values of the :py:mod:`segno.consts` constants. ``error`` is ``None``
      iff a M1 QR Code was generated, otherwise it is always an integer.
  
      :rtype: namedtuple
      """
      version = normalize_version(version)
      if not micro and micro is not None and version in consts.MICRO_VERSIONS:
          raise VersionError('A Micro QR Code version ("{0}") is provided but '
                             'parameter "micro" is False'
                             .format(get_version_name(version)))
      if micro and version is not None and version not in consts.MICRO_VERSIONS:
          raise VersionError('Illegal Micro QR Code version "{0}"'
                             .format(get_version_name(version)))
      error = normalize_errorlevel(error, accept_none=True)
      mode = normalize_mode(mode)
      if mode is not None and version is not None \
              and not is_mode_supported(mode, version):
          raise ModeError('Mode "{0}" is not available in version "{1}"'
                          .format(get_mode_name(mode), get_version_name(version)))
      if error == consts.ERROR_LEVEL_H and (micro or version in consts.MICRO_VERSIONS):
          raise ErrorLevelError('Error correction level "H" is not available for '
                                'Micro QR Codes')
      if eci and (micro or version in consts.MICRO_VERSIONS):
          raise VersionError('The ECI mode is not available for Micro QR Codes')
      segments = prepare_data(content, mode, encoding, version)
      guessed_version = find_version(segments, error, eci=eci, micro=micro)
      if version is None:
          version = guessed_version
      elif guessed_version > version:
          raise DataOverflowError('The provided data does not fit into version '
                                  '"{0}". Proposal: version {1}'
                                  .format(get_version_name(version),
                                          get_version_name(guessed_version)))
      if error is None and version != consts.VERSION_M1:
          error = consts.ERROR_LEVEL_L
      is_micro = version < 1
      mask = normalize_mask(mask, is_micro)
      return _encode(segments, error, version, mask, eci, boost_error)