def resolve_stream_name(streams, stream_name):
 if ((stream_name in STREAM_SYNONYMS) and (stream_name in streams)):
  for (name, stream) in streams.items():
   if ((stream is streams[stream_name]) and (name not in STREAM_SYNONYMS)):
    return name
 return stream_name

def resolve_stream_name ( streams , stream_name ) : if ( ( stream_name in STREAM_SYNONYMS ) and ( stream_name in streams ) ) : for ( name , stream ) in streams . items ( ) : if ( ( stream is streams [ stream_name ] ) and ( name not in STREAM_SYNONYMS ) ) : return name return stream_name
returns the real stream name of a synonym .