def combine_labels(left, right):
 if set(left).intersection(right):
  left = tuple(((l + u'0') for l in left))
  right = tuple(((r + u'1') for r in right))
 return (left + right)

def combine_labels ( left , right ) : if set ( left ) . intersection ( right ) : left = tuple ( ( ( l + u'0' ) for l in left ) ) right = tuple ( ( ( r + u'1' ) for r in right ) ) return ( left + right )
for use with the join operator &: combine left input/output labels with right input/output labels .