def merge_traces(mtraces):
 base_mtrace = mtraces[0]
 for new_mtrace in mtraces[1:]:
  for (new_chain, strace) in new_mtrace._straces.items():
   if (new_chain in base_mtrace._straces):
    raise ValueError('Chains are not unique.')
   base_mtrace._straces[new_chain] = strace
 return base_mtrace

def merge_traces ( mtraces ) : base_mtrace = mtraces [ 0 ] for new_mtrace in mtraces [ 1 : ] : for ( new_chain , strace ) in new_mtrace . _straces . items ( ) : if ( new_chain in base_mtrace . _straces ) : raise ValueError ( 'Chains are not unique.' ) base_mtrace . _straces [ new_chain ] = strace return base_mtrace
merge multitrace objects .