#NEWLINE# def delete( self , pkt = None , del_addr = None ) : #NEWLINE# #INDENT# if ( pkt is not None ) : #NEWLINE# #INDENT# del_list = [ pkt ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# assert ( del_addr is not None ) #NEWLINE# del_list = [ pkt for pkt in self if ( pkt . dst_ip in del_addr ) ] #NEWLINE# #UNINDENT# for pkt in del_list : #NEWLINE# #INDENT# self . remove ( pkt ) #NEWLINE# hub . kill ( pkt . wait_thread ) #NEWLINE# pkt . wait_thread . wait ( )