#NEWLINE# def get_frame( self , j ) : #NEWLINE# #INDENT# packet_no = self . _toc . searchsorted ( j , side = 'right' ) #NEWLINE# self . _seek_packet ( packet_no ) #NEWLINE# if ( packet_no == 0 ) : #NEWLINE# #INDENT# loc = j #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# loc = ( j - self . _toc [ ( packet_no - 1 ) ] ) #NEWLINE# #UNINDENT# frame = self . _current_packet [ loc ] #NEWLINE# if ( frame . index != result ) : #NEWLINE# #INDENT# raise AssertionError ( 'Seeking failed to obtain the correct frame.' ) #NEWLINE# #UNINDENT# result = np . asarray ( frame . to_rgb ( ) . to_image ( ) ) #NEWLINE# return Frame ( self . process_func ( result ) . astype ( self . _dtype ) , frame_no = j )