<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def save(cls, crawler, stage, level, run_id, error=None, message=None):
 """Create an event, possibly based on an exception."""

        event = {
            'stage': stage.name,
            'level': level,
            'timestamp': pack_now(),
            'error': error,
            'message': message
        }
        data = dump_json(event)
        conn.lpush(make_key(crawler, "events"), data)
        conn.lpush(make_key(crawler, "events", level), data)
        conn.lpush(make_key(crawler, "events", stage), data)
        conn.lpush(make_key(crawler, "events", stage, level), data)
        conn.lpush(make_key(crawler, "events", run_id), data)
        conn.lpush(make_key(crawler, "events", run_id, level), data)
        return event