code: def validate(self, ba):
          
          #
          # The code here is written for optimal JITting in PyPy, not for best
          # readability or particular elegance. Do NOT touch!
          #
          l = len(ba)
          i = 0
          state = self._state
          while i < l:
              # optimized version of decode(), since we are not interested in actual code points
              state = ord(
                  UTF8VALIDATOR_DFA_S[
                      256 + (state << 4) + ord(UTF8VALIDATOR_DFA_S[ord(ba[i])])
                  ]
              )
              if state == UTF8_REJECT:
                  self._state = state
                  self._index += i
                  return False, False, i, self._index
              i += 1
          self._state = state
          self._index += l
          return True, state == UTF8_ACCEPT, l, self._index
docs: Incrementally validate a chunk of bytes provided as string.
          Will return a quad ``(valid?, endsOnCodePoint?, currentIndex, totalIndex)``.
          As soon as an octet is encountered which renders the octet sequence
          invalid, a quad with ``valid? == False`` is returned. ``currentIndex`` returns
          the index within the currently consumed chunk, and ``totalIndex`` the
          index within the total consumed sequence that was the point of bail out.
          When ``valid? == True``, currentIndex will be ``len(ba)`` and ``totalIndex`` the
          total amount of consumed bytes.