def token(self, i, restrict=None):
        """Get the i'th token in the input.

        If C{i} is one past the end, then scan for another token.

        @param i: token index

        @param restrict: [token, ...] or C{None}; if restrict is
                         C{None}, then any token is allowed.  You may call
                         token(i) more than once.  However, the restrict set
                         may never be larger than what was passed in on the
                         first call to token(i).
        """
        if i > len(self.tokens):
            self.scan(restrict)
        if i < len(self.tokens):
            # Make sure the restriction is more restricted.  This
            # invariant is needed to avoid ruining tokenization at
            # position i+1 and higher.
            if restrict and self.restrictions[i]:
                for r in restrict:
                    if r not in self.restrictions[i]:
                        raise NotImplementedError("Unimplemented: restriction set changed")
            return self.tokens[i]
        raise NoMoreTokens()
dataset/ETHPy150Open kuri65536/python-for-android/python-modules/twisted/twisted/words/xish/xpathparser.py/Scanner.token/operator `==` -> `>`