#NEWLINE# def get_light( self , key ) : #NEWLINE# #INDENT# if ( self . _lights is None ) : #NEWLINE# #INDENT# lights = self . get_lights ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# lights = self . _lights #NEWLINE# #UNINDENT# if isinstance ( key , str ) : #NEWLINE# #INDENT# for light in lights : #NEWLINE# #INDENT# if ( light . name == key ) : #NEWLINE# #INDENT# return light #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# for light in lights : #NEWLINE# #INDENT# if ( light . light_id == light ) : #NEWLINE# #INDENT# return light #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# raise Exception ( ( 'Did not find light %s' % key ) )