Set parameters derived from heartbeat interval.
358630
private void setHeartbeatInterval(long heartbeatInterval,
                                    long heartbeatRecheckInterval) {
    this.heartbeatInterval = heartbeatInterval;
    this.heartbeatRecheckInterval = heartbeatRecheckInterval;
    this.heartbeatExpireInterval = 2 * heartbeatRecheckInterval +
      10 * heartbeatInterval;
    ReplicationConfigKeys.blockInvalidateLimit =
      Math.max(ReplicationConfigKeys.blockInvalidateLimit,
               20 * (int) (heartbeatInterval/1000L));
    
  }
567220
def set_parameters(self, parameter, value):
        
        if parameter == 'lo':
            self.parameters['lo'] = 1 / value
        else:
            self.parameters[parameter] = value
740365
def heartbeat(self, context, msg):
        """"""

        args = jsonutils.loads(msg)
        when = args.get('when')
        agent = args.get('agent')
        # The configurations in here, only used once when creating entry
        # for an agent in DB for the first time.
        configurations = {'uplink': ''}
        LOG.debug('heartbeat received: %(time)s - %(agent)s', (
                  {'time': when, 'agent': agent}))

        if self.obj.neutron_event:
            self.obj.neutron_event.create_rpc_client(agent)
        # Other option is to add the event to the queue for processig it later.

        self.obj.update_agent_status(agent, when)

        # Update the agents database.
        agent_info = dict(timestamp=utils.utc_time(when), host=agent,
                          config=jsonutils.dumps(configurations))
        self.obj.update_agent_db(agent_info)
511286
def setStimDuration(self):
        """"""
        duration = self.ui.durSpnbx.value()
        self.tone.setDuration(duration)
351017
protected function setupHeartbeat($interval)
    {
        $this->heartbeatInterval = $interval;
        if (isset($this->heartbeatTimer)) {
            $this->heartbeatTimer->cancel();
        }

        $interval             = $interval / 1000;
        $this->heartbeatTimer = $this->loop->addPeriodicTimer($interval, [$this, 'heartbeat']);
        $this->heartbeat();

        $this->logger->info('heartbeat timer initilized', ['interval' => $interval * 1000]);
    }
1070610
def set(self, value):
        """"""
        value = min(self.max, max(self.min, value))
        self._value = value
        start_new_thread(self.func, (self.get(),))
348296
private void scheduleHeartbeat()
  {
    // elapsed time in seconds since the last heartbeat
    long elapsedSecsSinceLastHeartBeat =
        System.currentTimeMillis() / 1000 - lastHeartbeatStartTimeInSecs;

    /*
     * The initial delay for the new scheduling is 0 if the elapsed
     * time is more than the heartbeat time interval, otherwise it is the
     * difference between the heartbeat time interval and the elapsed time.
     */
    long initialDelay = Math.max(heartBeatIntervalInSecs -
                                 elapsedSecsSinceLastHeartBeat, 0);

    LOGGER.debug(
        "schedule heartbeat task with initial delay of {} seconds",
        initialDelay);

    // Creates and executes a periodic action to send heartbeats
    this.heartbeatFuture =
        this.scheduler.schedule(this, initialDelay, TimeUnit.SECONDS);
  }
1262358
def set_params(method, params):
    """"""
    data = {'method': method, 'params': params, 'id': str(uuid4())}
    return json.dumps(data)
601647
public void setPeriod(ReadableInterval interval) {
        if (interval == null) {
            setPeriod(0L);
        } else {
            Chronology chrono = DateTimeUtils.getChronology(interval.getChronology());
            setPeriod(interval.getStartMillis(), interval.getEndMillis(), chrono);
        }
    }
1141190
def set(self, f):
        """"""
        self.stop()
        self._create_timer(f)
        self.start()
876663
def set_data(self, data):
        """"""
        for key, val in data.items():
            setattr(self, key, val)
        self.uptime['reloaded'] = datetime.now()
677851
def set_options(
        self,
        time_reset: int = 60,
        time_repeat: int = 0,
        repeat: int = 0,
        changes: int = 10,
    ) -> None:
        """"""
        self._time_reset = time_reset
        self._time_repeat = time_repeat
        self._repeat = repeat
        self._changes = changes
1128255
def heartbeat(self, min_interval=0):
        
        if not self._heartbeat:
            self._heartbeat = _PublisherHeartbeat(self)
        self._heartbeat(min_interval)
1197924
def set_temperature(self, zone, temperature, until=None):
        """"""
        if until is None:
            data = {"Value": temperature, "Status": "Hold", "NextTime": None}
        else:
            data = {"Value": temperature,
                    "Status": "Temporary",
                    "NextTime": until.strftime('%Y-%m-%dT%H:%M:%SZ')}

        self._set_heat_setpoint(zone, data)
237029
def _set_init_params(self, qrs_amp_recent, noise_amp_recent, rr_recent,
                         last_qrs_ind):
        
        self.qrs_amp_recent = qrs_amp_recent
        self.noise_amp_recent = noise_amp_recent
        # What happens if qrs_thr is calculated to be less than the explicit
        # min threshold? Should print warning?
        self.qrs_thr = max(0.25*self.qrs_amp_recent
                           + 0.75*self.noise_amp_recent,
                           self.qrs_thr_min * self.transform_gain)
        self.rr_recent = rr_recent
        self.last_qrs_ind = last_qrs_ind

        # No qrs detected initially
        self.last_qrs_peak_num = None
1159490
protected function heartbeatAgo()
    {
        if ($this->getParameter('value') != null) {
            $min = $this->getParameter('value');

            if ($min < 60)
                return $min.' min ago';
            elseif ($min < 1440)
                return floor($min / 60).' hrs '.($min % 60 > 0 ? floor($min % 60) .' min ' : '').'ago';
            else
                return floor($min / (24*60)).' days '.($min % (24*60) > 0 ? floor($min % (24*60) / 60).' hrs ' : '').'ago';
        }
    }
926493
def setStimReps(self):
        """"""
        reps = self.ui.nrepsSpnbx.value()
        self.stimModel.setRepCount(reps)