code: def _detect_bytelen_from_str(s):
          # type: (str) -> int
          
          assert(len(s) >= 2)
          tmp_len = len(s)
  
          i = 1
          while orb(s[i]) & 0x80 > 0:
              i += 1
              assert i < tmp_len, 'EINVAL: s: out-of-bound read: unfinished AbstractUVarIntField detected'  # noqa: E501
          ret = i + 1
  
          assert(ret >= 0)
          return ret
docs: _detect_bytelen_from_str returns the length of the machine
            representation of an AbstractUVarIntField starting at the beginning
            of s and which is assumed to expand over multiple bytes
            (value > _max_prefix_value).
  
          @param str s: the string to parse. It is assumed that it is a multibyte int.  # noqa: E501
          @return The bytelength of the AbstractUVarIntField.
          @raise AssertionError