Toggle the drone's emergency state.
767077
def reset(self):
        """"""
        self.at(ardrone.at.ref, False, True)
        time.sleep(0.1)
        self.at(ardrone.at.ref, False, False)
1230961
def set_alarm_state(self, state):
        
        values = {"desired_state": {"alarm_enabled": state}}
        response = self.api_interface.set_device_state(self, values)
        self._update_state_from_response(response)
1177927
function onStateChange(e)
    {
        if(scope._conn)
        {
            if(scope._conn.iceConnectionState == "connected")
            {
                if(scope.onConnected)
                {
                    scope.onConnected(scope);
                }
            }
            if(scope._conn.iceConnectionState == "failed" || scope._conn.iceConnectionState == "disconnected")
            {
                if(scope.onConnectionFail)
                {
                    scope.onConnectionFail(scope);
                }
                if(scope.type == "offer")
                {
                    scope.createOffer();
                }
            }
            if(scope._conn.iceConnectionState == "closed")
            {
                if(scope.onClosed)
                {
                    scope.onClosed(scope);
                }
                scope.dispose();
            }
        }
    }
1242390
def toggle(self, event=None):
        """"""
        if self.choice.get() == "yes":
            self.rbno.select()
        else:
            self.rbyes.select()
        self.widgetEdited()
258772
def freeze(self):
        
        self.target.disable()
        self.filter.configure(state='disable')
        self.prog_ob.configure(state='disable')
        self.pi.configure(state='disable')
        self.observers.configure(state='disable')
        self.comment.configure(state='disable')
1100414
def set_unavailable(self):
        """"""
        show = PresenceShow.NONE
        self.set_presence(PresenceState(available=False, show=show))
368741
def toggle_inhibit(self):
        """"""
        if self.inhibit:
            self._controller.set_inhibit(False)
            self.inhibit = False
        else:
            self._controller.set_inhibit(True)
            self.inhibit = True
1366602
def switch_on(self):
        """"""
        success = self.set_status(CONST.STATUS_ON_INT)

        if success:
            self._json_state['status'] = CONST.STATUS_ON

        return success
1355780
def _start_drone(self):
        

        with open(self.config_file, 'r') as config_file:
            self.config = json.load(config_file, object_hook=asciify)

        mode = None
        if self.config['general']['mode'] == '' or self.config['general']['mode'] is None:
            logger.info('Drone has not been configured, awaiting configuration from Beeswarm server.')
        elif self.config['general']['mode'] == 'honeypot':
            mode = Honeypot
        elif self.config['general']['mode'] == 'client':
            mode = Client

        if mode:
            self.drone = mode(self.work_dir, self.config)
            self.drone_greenlet = gevent.spawn(self.drone.start)
            self.drone_greenlet.link_exception(self.on_exception)
            logger.info('Drone configured and running. ({0})'.format(self.id))
585608
private function resetState()
    {
        $this->state['helo'] = false;
        $this->state['mail'] = false;
        $this->state['rcpt'] = false;
    }
768129
function findSwitchAndClear(uid) {
    if (uid) {
      droneModel.getProcessed({uid: uid}, function(err, result) {
        if (!err && result && result.length == 1) {
          switchAndClear(result[0]);
        }
      });
    }
  }
738628
function onExit () {
      if (!responded) {
        errState = true;
        responded = true;
        error = new Error('Error spawning drone');
        error.blame = {
          type: 'user',
          message: 'Script prematurely exited'
        }
        error.stdout = stdout.join('\n');
        error.stderr = stderr.join('\n');
        callback(error);

        //
        // Remove listeners to related events.
        //
        drone.removeListener('error', onError);
        drone.removeListener('message', onCarapacePort);
        clearTimeout(timeout);
      }
    }
1136130
public void toggle() {
    Command cmd = state.isPrimary() ? command1 : command2;
    setState(state.other());
    cmd.execute();
  }
46821
def toggle(self):
        
        for device in self:
            if isinstance(device, (OutputDevice, CompositeOutputDevice)):
                device.toggle()
967784
def move_right(self):
        """"""
        self.at(ardrone.at.pcmd, True, self.speed, 0, 0, 0)
1342697
def grok_state(self, obj):
        """"""
        if 'state' in obj:
            my_state = obj['state'].lower()
            if my_state != 'absent' and my_state != 'present':
                raise aomi_excep \
                    .Validation('state must be either "absent" or "present"')

        self.present = obj.get('state', 'present').lower() == 'present'
594247
def clear(self):
        '''
        
        '''

        # Add home point again.
        self.wait_ready()
        home = None
        try:
            home = self._vehicle._wploader.wp(0)
        except:
            pass
        self._vehicle._wploader.clear()
        if home:
            self._vehicle._wploader.add(home, comment='Added by DroneKit')
        self._vehicle._wpts_dirty = True