<s> __all__ = [ <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' <EOL> ] <EOL> import threading <EOL> import sys <EOL> import weakref <EOL> import array <EOL> import itertools <EOL> from multiprocessing import TimeoutError , cpu_count <EOL> from multiprocessing . dummy . connection import Pipe <EOL> from threading import Lock , RLock , Semaphore , BoundedSemaphore <EOL> from threading import Event <EOL> from Queue import Queue <EOL> class DummyProcess ( threading . Thread ) : <EOL> def __init__ ( self , group = None , target = None , name = None , args = ( ) , kwargs = { } ) : <EOL> threading . Thread . __init__ ( self , group , target , name , args , kwargs ) <EOL> self . _pid = None <EOL> self . _children = weakref . WeakKeyDictionary ( ) <EOL> self . _start_called = False <EOL> self . _parent = current_process ( ) <EOL> def start ( self ) : <EOL> assert self . _parent is current_process ( ) <EOL> self . _start_called = True <EOL> self . _parent . _children [ self ] = None <EOL> threading . Thread . start ( self ) <EOL> @ property <EOL> def exitcode ( self ) : <EOL> if self . _start_called and not self . is_alive ( ) : <EOL> return <NUM_LIT:0> <EOL> else : <EOL> return None <EOL> class Condition ( threading . _Condition ) : <EOL> notify_all = threading . _Condition . notify_all . im_func <EOL> Process = DummyProcess <EOL> current_process = threading . current_thread <EOL> current_process ( ) . _children = weakref . WeakKeyDictionary ( ) <EOL> def active_children ( ) : <EOL> children = current_process ( ) . _children <EOL> for p in list ( children ) : <EOL> if not p . is_alive ( ) : <EOL> children . pop ( p , None ) <EOL> return list ( children ) <EOL> def freeze_support ( ) : <EOL> pass <EOL> class Namespace ( object ) : <EOL> def __init__ ( self , ** kwds ) : <EOL> self . __dict__ . update ( kwds ) <EOL> def __repr__ ( self ) : <EOL> items = self . __dict__ . items ( ) <EOL> temp = [ ] <EOL> for name , value in items : <EOL> if not name . startswith ( '<STR_LIT:_>' ) : <EOL> temp . append ( '<STR_LIT>' % ( name , value ) ) <EOL> temp . sort ( ) <EOL> return '<STR_LIT>' % str . join ( '<STR_LIT:U+002CU+0020>' , temp ) <EOL> dict = dict <EOL> list = list <EOL> def Array ( typecode , sequence , lock = True ) : <EOL> return array . array ( typecode , sequence ) <EOL> class Value ( object ) : <EOL> def __init__ ( self , typecode , value , lock = True ) : <EOL> self . _typecode = typecode <EOL> self . _value = value <EOL> def _get ( self ) : <EOL> return self . _value <EOL> def _set ( self , value ) : <EOL> self . _value = value <EOL> value = property ( _get , _set ) <EOL> def __repr__ ( self ) : <EOL> return '<STR_LIT>' % ( type ( self ) . __name__ , self . _typecode , self . _value ) <EOL> def Manager ( ) : <EOL> return sys . modules [ __name__ ] <EOL> def shutdown ( ) : <EOL> pass <EOL> def Pool ( processes = None , initializer = None , initargs = ( ) ) : <EOL> from multiprocessing . pool import ThreadPool <EOL> return ThreadPool ( processes , initializer , initargs ) <EOL> JoinableQueue = Queue </s>
