#NEWLINE# def seek( self , pos , whence = 0 ) : #NEWLINE# #INDENT# if ( not ( 0 <= whence <= 2 ) ) : #NEWLINE# #INDENT# raise ValueError ( 'invalid whence value' ) #NEWLINE# #UNINDENT# with self . _read_lock : #NEWLINE# #INDENT# if ( self == 1 ) : #NEWLINE# #INDENT# pos -= ( len ( self . _read_buf ) - self . _read_pos ) #NEWLINE# #UNINDENT# pos = _BufferedIOMixin . seek ( self , pos , whence ) #NEWLINE# self . _reset_read_buf ( ) #NEWLINE# return pos