#NEWLINE# def _add_mapping( self , id , tc ) : #NEWLINE# #INDENT# 'Adds a mapping from id to IP address and vice versa.\n\n        It also updates the dict mapping IPs to TrafficControl configs.\n\n        Args:\n            id: the id to map.\n            tc: the TrafficControl object to map.\n        ' #NEWLINE# self . _id_to_ip_map [ id ] = tc . device . controlledIP #NEWLINE# self . _ip_to_id_map [ tc . device . controlledIP ] = tc #NEWLINE# self . _current_shapings [ tc . device . controlledIP ] = { #NEWLINE# #INDENT# 'tc' : tc , #NEWLINE# 'timeout' : ( time . time ( ) + tc . timeout ) , #NEWLINE# #UNINDENT# }