docs: def _parse_weights(weight_args, default_weight=0.6):
      """Parse list of weight assignments."""
      weights_dict = {}
      r_group_weight = default_weight
      for weight_arg in weight_args:
          for weight_assignment in weight_arg.split(','):
              if '=' not in weight_assignment:
                  raise ValueError(
                      'Invalid weight assignment: {}'.format(weight_assignment))
  
              key, value = weight_assignment.split('=', 1)
              value = float(value)
              if key == 'R':
                  r_group_weight = value
              elif key == '*':
                  default_weight = value
              elif hasattr(Atom, key):
                  weights_dict[Atom(key)] = value
              else:
                  raise ValueError('Invalid element: {}'.format(key))
  
      return weights_dict, r_group_weight, default_weight