<s> class ScanData : <EOL> def __init__ ( self , host_to_vulns , vuln_to_hosts , id_to_name , host_to_ip , id_to_severity ) : <EOL> self . host_to_vulns = host_to_vulns <EOL> self . vuln_to_hosts = vuln_to_hosts <EOL> self . id_to_name = id_to_name <EOL> self . host_to_ip = host_to_ip <EOL> self . id_to_severity = id_to_severity <EOL> def rebuild_host_to_vulns ( self ) : <EOL> self . host_to_vulns = { } <EOL> for vuln , hosts in self . vuln_to_hosts . iteritems ( ) : <EOL> for host in hosts : <EOL> if host not in self . host_to_vulns : <EOL> self . host_to_vulns [ host ] = set ( ) <EOL> self . host_to_vulns [ host ] . add ( vuln ) <EOL> def rebuild_vuln_to_hosts ( self ) : <EOL> self . vuln_to_hosts = { } <EOL> for host , vulns in self . host_to_vulns . iteritems ( ) : <EOL> for vuln in vulns : <EOL> if vuln not in self . vuln_to_hosts : <EOL> self . vuln_to_hosts [ vuln ] = set ( ) <EOL> self . vuln_to_hosts [ vuln ] . add ( host ) </s>
