def put(self, event_type, event_data={}, **kwargs):
event = dict(type=event_type, data=event_data)<EOL>event["<STR_LIT:time>"] = kwargs.get("<STR_LIT:time>", datetime.utcnow().isoformat())<EOL>if kwargs.get("<STR_LIT:id>"):<EOL><INDENT>event["<STR_LIT:id>"] = kwargs.get("<STR_LIT:id>")<EOL><DEDENT>data = json.dumps([event])<EOL>r = requests.post(self.collector_url + '<STR_LIT>',<EOL>data=data,<EOL>headers={'<STR_LIT>': '<STR_LIT:application/json>'})<EOL>r.raise_for_status()<EOL>return [event]<EOL>
Create/update an event.