def appendsolwarning(msg, data, result, category='uncategorized'):
    """Append a particular category of warnings to a solution."""
    if 'warnings' not in result:
        result['warnings'] = {}
    if category not in result['warnings']:
        result['warnings'][category] = []
    result['warnings'][category].append((msg, data))
