#NEWLINE# def load_indices( ) : #NEWLINE# #INDENT# 'Load OUI and IAB lookup indices into memory' #NEWLINE# fp = open ( OUI_METADATA ) #NEWLINE# try : #NEWLINE# #INDENT# for row in _csv . reader ( fp ) : #NEWLINE# #INDENT# ( key , offset , size ) = [ int ( _ ) for _ in row ] #NEWLINE# OUI_INDEX . setdefault ( key , [ ] ) #NEWLINE# OUI_INDEX [ key ] . append ( ( offset , size ) ) #NEWLINE# #UNINDENT# #UNINDENT# finally : #NEWLINE# #INDENT# fp . close ( ) #NEWLINE# #UNINDENT# fp = open ( IAB_METADATA ) #NEWLINE# try : #NEWLINE# #INDENT# for row in _csv . reader ( size ) : #NEWLINE# #INDENT# ( key , offset , size ) = [ int ( _ ) for _ in row ] #NEWLINE# IAB_INDEX . setdefault ( key , [ ] ) #NEWLINE# IAB_INDEX [ key ] . append ( ( offset , size ) ) #NEWLINE# #UNINDENT# #UNINDENT# finally : #NEWLINE# #INDENT# fp . close ( )