def create_event(name='TestEvent', creator_email=None, **kwargs):
 event = Event(name=name, start_time=datetime(2016, 4, 8, 12, 30, 45), end_time=datetime(2016, 4, 9, 12, 30, 45), **kwargs)
 if creator_email:
  event.creator = User.query.filter_by(email=creator_email).first()
 save_to_db(event, 'Event saved')
 copyright = Copyright(holder='copyright holder', event=event)
 save_to_db(copyright, 'Copyright saved')
 if creator_email:
  data = {'user_email': creator_email, 'user_role': ORGANIZER}
  DataManager.add_role_to_event(data, event.id, record=False)
 return event.id

def create_event ( name = 'TestEvent' , creator_email = None , ** kwargs ) : event = Event ( name = name , start_time = datetime ( 2016 , 4 , 8 , 12 , 30 , 45 ) , end_time = datetime ( 2016 , 4 , 9 , 12 , 30 , 45 ) , ** kwargs ) if creator_email : event . creator = User . query . filter_by ( email = creator_email ) . first ( ) save_to_db ( event , 'Event saved' ) copyright = Copyright ( holder = 'copyright holder' , event = event ) save_to_db ( copyright , 'Copyright saved' ) if creator_email : data = { 'user_email' : creator_email , 'user_role' : ORGANIZER } DataManager . add_role_to_event ( data , event . id , record = False ) return event . id
create an event on the victorops service .