(self, index)
Set the index to which the functions relate.

        The index must be in the same statement.
Set the index to which the functions relate.
Set the index to which the functions relate .
def set_index(self, index):
        """Set the index to which the functions relate.

        The index must be in the same statement.
        """
        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
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