def format_valid_streams(plugin, streams):
 delimiter = ', '
 validstreams = []
 for (name, stream) in sorted(streams.items(), key=(lambda stream: plugin.stream_weight(stream[0]))):
  if (name in STREAM_SYNONYMS):
   continue
  synonymfilter = (lambda n: ((stream is streams[n]) and (n is not name)))
  synonyms = list(filter(synonymfilter, streams.keys()))
  if (len(synonyms) > 0):
   joined = delimiter.join(synonyms)
   name = '{0} ({1})'.format(name, joined)
  validstreams.append(name)
 return delimiter.join(validstreams)

def format_valid_streams ( plugin , streams ) : delimiter = ', ' validstreams = [ ] for ( name , stream ) in sorted ( streams . items ( ) , key = ( lambda stream : plugin . stream_weight ( stream [ 0 ] ) ) ) : if ( name in STREAM_SYNONYMS ) : continue synonymfilter = ( lambda n : ( ( stream is streams [ n ] ) and ( n is not name ) ) ) synonyms = list ( filter ( synonymfilter , streams . keys ( ) ) ) if ( len ( synonyms ) > 0 ) : joined = delimiter . join ( synonyms ) name = '{0} ({1})' . format ( name , joined ) validstreams . append ( name ) return delimiter . join ( validstreams )
formats a dict of streams .