update_dict = { k : int ( v [ 0 ] ) for k , v in request_body. iteritems ( ) if k in non_array_items_ints }

update_dict. update ( { k : v [ 0 ] for k , v in request_body. iteritems ( ) if k in non_array_items_str } )

update_dict. update ( { k : v - v % 60 for k , v in update_dict. iteritems ( ) if k in [ 'start_time' ] } )

if update_dict [ 'end_time' ] % 60 > 0 :

update_dict. update ( { k : v + 60 - ( v % 60 ) for k , v in update_dict. iteritems ( ) if k in [ 'end_time' ] } )

update_dict. update ( { k : v for k , v in defaults. iteritems ( ) if k not in request_body } )

if update_dict: