#NEWLINE# def get_label_map( labels ) : #NEWLINE# #INDENT# '\n    return a dictionary with integer:string mapping\n    ' #NEWLINE# label_set = set ( ) #NEWLINE# map_dict = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for val in labels : #NEWLINE# #INDENT# label_set . update ( val ) #NEWLINE# #UNINDENT# for ( lab , integer ) in enumerate ( label_set ) : #NEWLINE# #INDENT# map_dict [ integer ] = lab #NEWLINE# #UNINDENT# return map_dict