def tokens(self, key):
        buf = ""
        for char in key:
            if char == "[":
                yield QueryStringToken.ARRAY, buf
                buf = ""

            elif char == ".":
                yield QueryStringToken.OBJECT, buf
                buf = ""

            elif char == "]":
                try:
                    yield QueryStringToken.KEY, int(buf)
                    buf = ""
                except __HOLE__:
                    yield QueryStringToken.KEY, None
            else:
                buf = buf + char

        if len(buf) > 0:
            yield QueryStringToken.KEY, buf
        else:
            raise StopIteration()
dataset/ETHPy150Open circuits/circuits/circuits/web/parsers/querystring.py/QueryStringParser.tokens