docs: def decoder(data):
      """
      This generator processes a sequence of bytes in Modified UTF-8 encoding
      and produces a sequence of unicode string characters.
  
      It takes bits from the byte until it matches one of the known encoding
      sequences.
      It uses ``DecodeMap`` to mask, compare and generate values.
  
      :param data: a string of bytes in Modified UTF-8 encoding.
      :return: a generator producing a string of unicode characters
      :raises UnicodeDecodeError: unrecognised byte in sequence encountered.
      """
  
      def next_byte(_it, start, count):
          try:
              return next(_it)[1]
          except StopIteration:
              raise UnicodeDecodeError(
                  NAME, data, start, start + count, "incomplete byte sequence"
              )
  
      it = iter(enumerate(data))
      for i, d in it:
          if d == 0x00:  # 00000000
              raise UnicodeDecodeError(
                  NAME, data, i, i + 1, "embedded zero-byte not allowed"
              )
          elif d & 0x80:  # 1xxxxxxx
              if d & 0x40:  # 11xxxxxx
                  if d & 0x20:  # 111xxxxx
                      if d & 0x10:  # 1111xxxx
                          raise UnicodeDecodeError(
                              NAME, data, i, i + 1, "invalid encoding character"
                          )
                      elif d == 0xED:
                          value = 0
                          for i1, dm in enumerate(DECODE_MAP[6]):
                              d1 = next_byte(it, i, i1 + 1)
                              value = dm.apply(d1, value, data, i, i1 + 1)
                      else:  # 1110xxxx
                          value = d & 0x0F
                          for i1, dm in enumerate(DECODE_MAP[3]):
                              d1 = next_byte(it, i, i1 + 1)
                              value = dm.apply(d1, value, data, i, i1 + 1)
                  else:  # 110xxxxx
                      value = d & 0x1F
                      for i1, dm in enumerate(DECODE_MAP[2]):
                          d1 = next_byte(it, i, i1 + 1)
                          value = dm.apply(d1, value, data, i, i1 + 1)
              else:  # 10xxxxxx
                  raise UnicodeDecodeError(
                      NAME, data, i, i + 1, "misplaced continuation character"
                  )
          else:  # 0xxxxxxx
              value = d
          # noinspection PyCompatibility
          yield mutf8_unichr(value)