#NEWLINE# def tuple_for_index( self , index ) : #NEWLINE# #INDENT# if ( index < 0 ) : #NEWLINE# #INDENT# index = ( self . length ( ) + index ) #NEWLINE# #UNINDENT# l = len ( self . _locked_chain ) #NEWLINE# if ( index < l ) : #NEWLINE# #INDENT# return self . _locked_chain [ index ] #NEWLINE# #UNINDENT# index -= l #NEWLINE# longest_chain = self . _longest_local_block_chain ( ) #NEWLINE# the_hash = longest_chain [ ( ( - index ) - 1 ) ] #NEWLINE# parent_hash = ( self . parent_hash if ( index <= 0 ) else self . _longest_chain_cache [ ( - index ) ] ) #NEWLINE# weight = self . weight_lookup . get ( the_hash ) #NEWLINE# return ( longest_chain , parent_hash , weight )