def _parse_weights(weight_args, default_weight=<NUM_LIT>):
weights_dict = {}<EOL>r_group_weight = default_weight<EOL>for weight_arg in weight_args:<EOL><INDENT>for weight_assignment in weight_arg.split('<STR_LIT:U+002C>'):<EOL><INDENT>if '<STR_LIT:=>' not in weight_assignment:<EOL><INDENT>raise ValueError(<EOL>'<STR_LIT>'.format(weight_assignment))<EOL><DEDENT>key, value = weight_assignment.split('<STR_LIT:=>', <NUM_LIT:1>)<EOL>value = float(value)<EOL>if key == '<STR_LIT:R>':<EOL><INDENT>r_group_weight = value<EOL><DEDENT>elif key == '<STR_LIT:*>':<EOL><INDENT>default_weight = value<EOL><DEDENT>elif hasattr(Atom, key):<EOL><INDENT>weights_dict[Atom(key)] = value<EOL><DEDENT>else:<EOL><INDENT>raise ValueError('<STR_LIT>'.format(key))<EOL><DEDENT><DEDENT><DEDENT>return weights_dict, r_group_weight, default_weight<EOL>
Parse list of weight assignments.