def call_blink(*args, **kwargs):
 devices = _get_lights()
 pause = kwargs.get('pause', 0)
 res = dict()
 for dev_id in ((('id' not in kwargs) and sorted(devices.keys())) or _get_devices(kwargs)):
  state = devices[str(dev_id)]['state']['on']
  _set(dev_id, ((state and Const.LAMP_OFF) or Const.LAMP_ON))
  if pause:
   time.sleep(pause)
  res[dev_id] = _set(dev_id, (((not state) and Const.LAMP_OFF) or Const.LAMP_ON))
 return res

def call_blink ( * args , ** kwargs ) : devices = _get_lights ( ) pause = kwargs . get ( 'pause' , 0 ) res = dict ( ) for dev_id in ( ( ( 'id' not in kwargs ) and sorted ( devices . keys ( ) ) ) or _get_devices ( kwargs ) ) : state = devices [ str ( dev_id ) ] [ 'state' ] [ 'on' ] _set ( dev_id , ( ( state and Const . LAMP_OFF ) or Const . LAMP_ON ) ) if pause : time . sleep ( pause ) res [ dev_id ] = _set ( dev_id , ( ( ( not state ) and Const . LAMP_OFF ) or Const . LAMP_ON ) ) return res
blink a lamp .