#NEWLINE# def get_station_index( self , station ) : #NEWLINE# #INDENT# 'Returns the index of the station accordingly to the parameter station type' #NEWLINE# if ( type ( station ) is int ) : #NEWLINE# #INDENT# assert ( 0 <= station < len ( self . stations ) ) #NEWLINE# return station #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( type ( station ) is str ) : #NEWLINE# #INDENT# return self . stations . index ( station ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( type ( station ) is dict ) : #NEWLINE# #INDENT# return self . stations . index ( station [ 'call_sign' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return self . stations . index ( self . call_sign )