<s> """<STR_LIT>""" <EOL> import networkx <EOL> from networkx . generators . classic import empty_graph <EOL> from eventful_dict import EventfulDict <EOL> class EventfulGraph ( networkx . Graph ) : <EOL> _constructed_callback = None <EOL> @ staticmethod <EOL> def on_constructed ( callback ) : <EOL> """<STR_LIT>""" <EOL> if callback is None or callable ( callback ) : <EOL> EventfulGraph . _constructed_callback = callback <EOL> def __init__ ( self , * pargs , ** kwargs ) : <EOL> """<STR_LIT>""" <EOL> super ( EventfulGraph , self ) . __init__ ( * pargs , ** kwargs ) <EOL> sleep = kwargs . get ( '<STR_LIT>' , <NUM_LIT:0.0> ) <EOL> self . graph = EventfulDict ( self . graph , sleep = sleep ) <EOL> self . node = EventfulDict ( self . node , sleep = sleep ) <EOL> self . adj = EventfulDict ( self . adj , sleep = sleep ) <EOL> if EventfulGraph . _constructed_callback : <EOL> EventfulGraph . _constructed_callback ( self ) <EOL> def empty_eventfulgraph_hook ( * pargs , ** kwargs ) : <EOL> def wrapped ( * wpargs , ** wkwargs ) : <EOL> """<STR_LIT>""" <EOL> wkwargs [ '<STR_LIT>' ] = EventfulGraph ( * pargs , ** kwargs ) <EOL> return empty_graph ( * wpargs , ** wkwargs ) <EOL> return wrapped </s>
