Sets the idle Pointer Counter (PC)

        :param idlepc: idlepc value (string)
193110
def set_idlepc(self, idlepc):
        

        if not idlepc:
            idlepc = "0x0"

        is_running = yield from self.is_running()
        if not is_running:
            # router is not running
            yield from self._hypervisor.send('vm set_idle_pc "{name}" {idlepc}'.format(name=self._name, idlepc=idlepc))
        else:
            yield from self._hypervisor.send('vm set_idle_pc_online "{name}" 0 {idlepc}'.format(name=self._name, idlepc=idlepc))

        log.info('Router "{name}" [{id}]: idle-PC set to {idlepc}'.format(name=self._name, id=self._id, idlepc=idlepc))
        self._idlepc = idlepc
574151
def on_idle(self, event):
        ''''''
        state = self.state
        now = time.time()
        if now - self.last_layout_send > 1:
            self.last_layout_send = now
            state.out_queue.put(win_layout.get_wx_window_layout(self))
        time.sleep(0.1)
712374
def watch_thread(self):
        ''''''
        from mp_settings import MPSetting
        while True:
            setting = self.child_pipe.recv()
            if not isinstance(setting, MPSetting):
                break
            try:
                self.settings.set(setting.name, setting.value)
            except Exception:
                print("Unable to set %s to %s" % (setting.name, setting.value))
844473
def idle_task(self):
        ''''''
        if self.accelcal_count != -1:
            if self.accelcal_wait_enter and self.empty_input_count != self.mpstate.empty_input_count:
                self.accelcal_wait_enter = False
                self.accelcal_count += 1
                # tell the APM that user has done as requested
                self.master.mav.command_ack_send(self.accelcal_count, 1)
                if self.accelcal_count >= 6:
                    self.accelcal_count = -1

        if self.compassmot_running:
            if self.mpstate.empty_input_count != self.empty_input_count:
                # user has hit enter, stop the process
                    self.compassmot_running = False
                    print("sending stop")
                    self.master.mav.command_ack_send(0, 1)
1031206
def idle_task(self):
        ''''''
        if not self.connection:
            return

        # check for a mavlink message from the tracker
        m = self.connection.recv_msg()
        if m is None:
            return

        if self.tracker_settings.debug:
            print(m)

        self.pstate.handle_mavlink_packet(self.connection, m)
        self.pstate.fetch_check(self.connection)

        if self.module('map') is None:
            return

        if m.get_type() == 'GLOBAL_POSITION_INT':
            (self.lat, self.lon, self.heading) = (m.lat*1.0e-7, m.lon*1.0e-7, m.hdg*0.01)
            if self.lat != 0 or self.lon != 0:
                self.module('map').create_vehicle_icon('AntennaTracker', 'red', follow=False, vehicle_type='antenna')
                self.mpstate.map.set_position('AntennaTracker', (self.lat, self.lon), rotation=self.heading)
842530
private Counter initAndRegisterCounter(String name) {
        BasicCounter counter = new BasicCounter(MonitorConfig.builder(name).build());
        DefaultMonitorRegistry.getInstance().register(counter);
        return counter;
    }
744396
private void sawMonitorExit(int pc) {
        if (!monitorSyncPCs.isEmpty()) {
            ScopeBlock sb = findSynchronizedScopeBlock(rootScopeBlock, monitorSyncPCs.get(0).intValue());
            if (sb != null) {
                sb.setFinish(pc);
            }
            monitorSyncPCs.remove(monitorSyncPCs.size() - 1);
        }
    }
678164
def num_unused_cpus(thresh=10):
    
    import psutil
    cpu_usage = psutil.cpu_percent(percpu=True)
    return sum([p < thresh for p in cpu_usage])
1154746
def set_alt(self, i, alt, break_alt=None, change_time=True):
        ''''''
        if i < 1 or i > self.rally_count():
            print("Inavlid rally point number %u" % i)
            return
        self.rally_points[i-1].alt = int(alt)
        if (break_alt != None):
            self.rally_points[i-1].break_alt = break_alt
        if change_time:
            self.last_change = time.time()
758858
def on_idle(self, event):
        ''''''
        # Check for resize
        self.checkReszie()
        
        if self.resized:
            # Fix Window Scales 
            self.rescaleX()
            self.calcFontScaling()
            
            # Recalculate Horizon Polygons
            self.calcHorizonPoints()
            
            # Update Roll, Pitch, Yaw Text Locations
            self.updateRPYLocations()
            
            # Update Airpseed, Altitude, Climb Rate Locations
            self.updateAARLocations()
            
            # Update Pitch Markers
            self.adjustPitchmarkers()
            
            # Update Heading and North Pointer
            self.adjustHeadingPointer()
            self.adjustNorthPointer()
            
            # Update Battery Bar
            self.updateBatteryBar()
            
            # Update Mode and State
            self.updateStateText()
            
            # Update Waypoint Text
            self.updateWPText()
            
            # Adjust Waypoint Pointer
            self.adjustWPPointer()
            
            # Update History Plot
            self.updateAltHistory()
            
            # Update Matplotlib Plot
            self.canvas.draw()
            self.canvas.Refresh()
            
            self.resized = False
        
        time.sleep(0.05)
93246
def idle_task(self):
        ''''''
        try:
            data = self.port.recv(1024) # Attempt to read up to 1024 bytes.
        except socket.error as e:
            if e.errno in [ errno.EAGAIN, errno.EWOULDBLOCK ]:
                return
            raise
        try:
            self.send_rtcm_msg(data)

        except Exception as e:
            print("DGPS: GPS Inject Failed:", e)
366109
@Benchmark
  public void pingPong(AdditionalCounters counters) throws Exception {
    record.set(true);
    // No need to do anything, just sleep here.
    Thread.sleep(1001);
    record.set(false);
  }
292936
def setKeySequenceCounter(self, iKeySequenceValue):
        
        print '%s call setKeySequenceCounter' % self.port
        print iKeySequenceValue
        try:
            cmd = WPANCTL_CMD + 'setprop Network:KeyIndex %s' % str(iKeySequenceValue)
            if self.__sendCommand(cmd)[0] != 'Fail':
                time.sleep(1)
                return True
            else:
                return False
        except Exception, e:
            ModuleHelper.WriteIntoDebugLogger('setKeySequenceCounter() Error: ' + str(e))
597182
function get_cpu_idle() {
  var idle = 0;
  var cpus = os.cpus();
  var i, len;
  for (i=0, len = cpus.length; i < len; i += 1) {
    var cpu = cpus[i];
    var total = cpu.times.sys + cpu.times.idle + cpu.times.user + cpu.times.nice + cpu.times.irq;
    idle += (cpu.times.idle/total*100);
  }
  idle = idle / cpus.length;
  return idle;
}
797416
def idle_task(self):
        ''''''
        if not self.started:
            return
        now = time.time()
        if now - self.last_packet < 1:
            timeout = 0.05
        else:
            timeout = 0.2
        if now - self.last_check > timeout:
            self.last_check = now
            mav = self.master.mav
            flags = mavutil.mavlink.SERIAL_CONTROL_FLAG_RESPOND
            flags |= mavutil.mavlink.SERIAL_CONTROL_FLAG_MULTI
            flags |= mavutil.mavlink.SERIAL_CONTROL_FLAG_EXCLUSIVE
            mav.serial_control_send(self.serial_settings.port,
                                    flags,
                                    0, self.serial_settings.baudrate,
                                    0, [0]*70)
125291
public void setIdleMin(int min)
  {
    if (min == _idleMin) {
      // avoid update() overhead if unchanged
      return;
    }
    
    if (min <= 0) {
      min = DEFAULT_IDLE_MIN;
    }
    
    if (_threadMax < min)
      throw new ConfigException(L.l("IdleMin ({0}) must be less than ThreadMax ({1})", min, _threadMax));
    if (min <= 0)
      throw new ConfigException(L.l("IdleMin ({0}) must be greater than 0.", min));

    _idleMin = min;
    
    update();
  }
1148335
def dynamips_auto_idlepc(self):
        
        return (yield from self._compute.get("/projects/{}/{}/nodes/{}/auto_idlepc".format(self._project.id, self._node_type, self._id), timeout=240)).json