def add_or_update_given_trace_db(trace_db, action_executions=None, rules=None, trigger_instances=None):
 if (trace_db is None):
  raise ValueError('trace_db should be non-None.')
 if (not action_executions):
  action_executions = []
 action_executions = [_to_trace_component_db(component=action_execution) for action_execution in action_executions]
 if (not rules):
  rules = []
 rules = [_to_trace_component_db(component=rule) for rule in rules]
 if (not trigger_instances):
  trigger_instances = []
 trigger_instances = [_to_trace_component_db(component=trigger_instance) for trigger_instance in trigger_instances]
 if trace_db.id:
  return Trace.push_components(trace_db, action_executions=action_executions, rules=rules, trigger_instances=trigger_instances)
 trace_db.action_executions = action_executions
 trace_db.rules = rules
 trace_db.trigger_instances = trigger_instances
 return Trace.add_or_update(trace_db)

def add_or_update_given_trace_db ( trace_db , action_executions = None , rules = None , trigger_instances = None ) : if ( trace_db is None ) : raise ValueError ( 'trace_db should be non-None.' ) if ( not action_executions ) : action_executions = [ ] action_executions = [ _to_trace_component_db ( component = action_execution ) for action_execution in action_executions ] if ( not rules ) : rules = [ ] rules = [ _to_trace_component_db ( component = rule ) for rule in rules ] if ( not trigger_instances ) : trigger_instances = [ ] trigger_instances = [ _to_trace_component_db ( component = trigger_instance ) for trigger_instance in trigger_instances ] if trace_db . id : return Trace . push_components ( trace_db , action_executions = action_executions , rules = rules , trigger_instances = trigger_instances ) trace_db . action_executions = action_executions trace_db . rules = rules trace_db . trigger_instances = trigger_instances return Trace . add_or_update ( trace_db )
will update an existing trace .