'Create a new event for event-collector.
topic: Used to filter events into appropriate streams for processing
event_type: Used for grouping and sub-categorizing events
time: Should be a datetime.datetime object in UTC timezone
uuid: Should be a UUID object
request, context: Should be pylons.request & pylons.c respectively
testing: Whether to send the event to the test endpoint
data: A dict of field names/values to initialize the payload with
obfuscated_data: Same as `data`, but fields that need obfuscation
truncatable_field: Field to truncate if the event is too large'

def __init__(self, topic, event_type, time=None, uuid=None, request=None, context=None, testing=False, data=None, obfuscated_data=None, truncatable_field=None):

    self.topic = topic
    self.event_type = event_type
    self.testing = (testing or g.debug)
    self.truncatable_field = truncatable_field
    if (not time):
        time = datetime.datetime.now(pytz.UTC)
    self.timestamp = _datetime_to_millis(time)
    if (not uuid):
        uuid = uuid4()
    self.uuid = str(uuid)
    self.payload = {}
    if data:
        self.payload.update(data)
    self.obfuscated_data = {}
    if obfuscated_data:
        self.obfuscated_data.update(obfuscated_data)
    if (context and request):
        context_data = self.get_context_data(request, context)
        new_context_data = {k: v for (k, v) in context_data.items() if (k not in self.payload)}
        self.payload.update(new_context_data)
        context_data = self.get_sensitive_context_data(request, context)
        new_context_data = {k: v for (k, v) in context_data.items() if (k not in self.obfuscated_data)}
        self.obfuscated_data.update(new_context_data)
