'Create a \'quarantine\' event for event-collector.
event_type: quarantine_interstitial_view, quarantine_opt_in,
quarantine_opt_out, quarantine_interstitial_dismiss
subreddit: The quarantined subreddit
request, context: Should be pylons.request & pylons.c respectively'

@squelch_exceptions
@sampled('events_collector_quarantine_sample_rate')
def quarantine_event(self, event_type, subreddit, request=None, context=None):

    event = Event(topic='quarantine', event_type=event_type, request=request, context=context)
    if context:
        if context.user_is_loggedin:
            event.add('verified_email', context.user.email_verified)
        else:
            event.add('verified_email', False)
    if (request and ((event_type == 'quarantine_interstitial_view') or (event_type == 'quarantine_opt_out'))):
        request_vars = request.environ['pylons.routes_dict']
        event.add('sr_action', request_vars.get('action', None))
        if request.environ['pylons.routes_dict'].get('comment', None):
            thing_id36 = request_vars.get('comment', None)
        else:
            thing_id36 = request_vars.get('article', None)
        if thing_id36:
            event.add('thing_id', int(thing_id36, 36))
    event.add_subreddit_fields(subreddit)
    self.save_event(event)
