def set_index(self, index):
        indexinrawtext = (len(self.rawtext) -
                          len(self.text.get(index, self.stopatindex)))
        if indexinrawtext < 0:
            raise ValueError("Index %s precedes the analyzed statement"
                             % index)
        self.indexinrawtext = indexinrawtext
        # find the rightmost bracket to which index belongs
        self.indexbracket = 0
        while (self.indexbracket < len(self.bracketing)-1 and
               self.bracketing[self.indexbracket+1][0] < self.indexinrawtext):
            self.indexbracket += 1
        if (self.indexbracket < len(self.bracketing)-1 and
            self.bracketing[self.indexbracket+1][0] == self.indexinrawtext and
           not self.isopener[self.indexbracket+1]):
            self.indexbracket += 1
Validate the configuration and return an snmp scanner.
dataset/ETHPy150Open francelabs/datafari/windows/python/Lib/idlelib/HyperParser.py/HyperParser.set_index--crossover with--dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/device_tracker/snmp.py/get_scanner