<s> import random <EOL> import time <EOL> import threading <EOL> class objectHashHolder ( threading . Thread ) : <EOL> def __init__ ( self , sendDataThreadMailbox ) : <EOL> threading . Thread . __init__ ( self ) <EOL> self . shutdown = False <EOL> self . sendDataThreadMailbox = sendDataThreadMailbox <EOL> self . collectionOfHashLists = { } <EOL> self . collectionOfPeerLists = { } <EOL> for i in range ( <NUM_LIT:10> ) : <EOL> self . collectionOfHashLists [ i ] = [ ] <EOL> self . collectionOfPeerLists [ i ] = [ ] <EOL> def run ( self ) : <EOL> iterator = <NUM_LIT:0> <EOL> while not self . shutdown : <EOL> if len ( self . collectionOfHashLists [ iterator ] ) > <NUM_LIT:0> : <EOL> self . sendDataThreadMailbox . put ( ( <NUM_LIT:0> , '<STR_LIT>' , self . collectionOfHashLists [ iterator ] ) ) <EOL> self . collectionOfHashLists [ iterator ] = [ ] <EOL> if len ( self . collectionOfPeerLists [ iterator ] ) > <NUM_LIT:0> : <EOL> self . sendDataThreadMailbox . put ( ( <NUM_LIT:0> , '<STR_LIT>' , self . collectionOfPeerLists [ iterator ] ) ) <EOL> self . collectionOfPeerLists [ iterator ] = [ ] <EOL> iterator += <NUM_LIT:1> <EOL> iterator %= <NUM_LIT:10> <EOL> time . sleep ( <NUM_LIT:1> ) <EOL> def holdHash ( self , hash ) : <EOL> self . collectionOfHashLists [ random . randrange ( <NUM_LIT:0> , <NUM_LIT:10> ) ] . append ( hash ) <EOL> def holdPeer ( self , peerDetails ) : <EOL> self . collectionOfPeerLists [ random . randrange ( <NUM_LIT:0> , <NUM_LIT:10> ) ] . append ( peerDetails ) <EOL> def close ( self ) : <EOL> self . shutdown = True </s>
