<s> from lib . action import BaseAction <EOL> class LookupDeviceAction ( BaseAction ) : <EOL> def run ( self , name , device_type ) : <EOL> url = "<STR_LIT>" . format ( device_type ) <EOL> for device in self . _get ( url ) : <EOL> if device [ '<STR_LIT:label>' ] == name : <EOL> return device [ '<STR_LIT:id>' ] </s>
