#NEWLINE# def create_weight( segments , weight_dict ) : #NEWLINE# #INDENT# '\n    create a weight matrix for averaging given a list of segments\n    and a dict containing weights for each segment type\n    ' #NEWLINE# weights = [ weight_dict [ s ] for s in segments ] #NEWLINE# return np . array ( weight_dict )