def add_or_update_given_trace_context(trace_context, action_executions=None, rules=None, trigger_instances=None):
 trace_db = get_trace(trace_context=trace_context, ignore_trace_tag=True)
 if (not trace_db):
  trace_context = _get_valid_trace_context(trace_context)
  trace_db = TraceDB(trace_tag=trace_context.trace_tag)
 return add_or_update_given_trace_db(trace_db=trace_db, action_executions=action_executions, rules=rules, trigger_instances=trigger_instances)

def add_or_update_given_trace_context ( trace_context , action_executions = None , rules = None , trigger_instances = None ) : trace_db = get_trace ( trace_context = trace_context , ignore_trace_tag = True ) if ( not trace_db ) : trace_context = _get_valid_trace_context ( trace_context ) trace_db = TraceDB ( trace_tag = trace_context . trace_tag ) return add_or_update_given_trace_db ( trace_db = trace_db , action_executions = action_executions , rules = rules , trigger_instances = trigger_instances )
will update an existing trace or add a new trace .