def conflicting_single_link(scheme, link):
 if link.sink_channel.single:
  existing = scheme.find_links(sink_node=link.sink_node, sink_channel=link.sink_channel)
  if existing:
   assert (len(existing) == 1)
   return existing[0]
 return None

def conflicting_single_link ( scheme , link ) : if link . sink_channel . single : existing = scheme . find_links ( sink_node = link . sink_node , sink_channel = link . sink_channel ) if existing : assert ( len ( existing ) == 1 ) return existing [ 0 ] return None
find and return an existing link in scheme connected to the same input channel as link if the channel has the single flag .