#NEWLINE# def set_index( self , index ) : #NEWLINE# #INDENT# 'Set the index to which the functions relate.\n\n        The index must be in the same statement.\n        ' #NEWLINE# indexinrawtext = ( len ( self . rawtext ) - len ( self . text . get ( index , self . stopatindex ) ) ) #NEWLINE# if ( indexinrawtext < 0 ) : #NEWLINE# #INDENT# raise ValueError ( ( 'Index %s precedes the analyzed statement' % index ) ) #NEWLINE# #UNINDENT# self . indexinrawtext = indexinrawtext #NEWLINE# self . indexbracket = 0 #NEWLINE# while ( ( self . indexbracket < ( len ( self . bracketing ) - 1 ) ) and ( self . bracketing [ ( self . indexbracket + 1 ) ] [ 0 ] < self . indexinrawtext ) ) : #NEWLINE# #INDENT# self . indexbracket += 1 #NEWLINE# #UNINDENT# if ( ( self . indexbracket < ( len ( self . bracketing ) - 1 ) ) and ( self . bracketing [ ( self . indexbracket + 1 ) ] [ 0 ] == self . indexinrawtext ) and ( not self . isopener [ ( self . indexbracket + 1 ) ] ) ) : #NEWLINE# #INDENT# self . indexbracket += 1