:param din: bit in
        :param reload: when True, reloads the initial value to LFSR
        :return: current LFSR value (integer), CRC is correct if this is 0. Once it gets to 0 it STAYS 0, reset needed.
428864
def main(self, din, reload):
        
        if reload:
            lfsr = self.INIT_GALOIS
        else:
            lfsr = self.lfsr
        out = lfsr & 0x8000
        next = ((lfsr << 1) | din) & 0xFFFF
        if out != 0:
            next = next ^ self.XOR
        self.lfsr = next
        return self.lfsr
836570
def reload(self, result=None):
        

        if result is None:
            result = self._client._get(
                self.__class__.base_url(
                    self.sys['space'].id,
                    self.sys['id'],
                    environment_id=self._environment_id
                )
            )

        self._update_from_resource(result)

        return self
473642
def _callback(self, *dummy):
        
        # retrieve the value from the Entry
        value = self._variable.get()
        # run the validation. Returns None if no good
        newvalue = self.validate(value)
        if newvalue is None:
            # Invalid: restores previously stored value
            # no checker run.
            self._variable.set(self.as_string())
        else:
            # Store new value
            self._value = coord.Angle(value, unit=self.unit)
            if self.checker:
                self.checker(*dummy)
770553
def _number_zero_start_handler(c, ctx):
    
    assert c == _ZERO
    assert len(ctx.value) == 0 or (len(ctx.value) == 1 and ctx.value[0] == _MINUS)
    ctx.set_ion_type(IonType.INT)
    ctx.value.append(c)
    c, _ = yield
    if _ends_value(c):
        trans = ctx.event_transition(IonThunkEvent, IonEventType.SCALAR, ctx.ion_type, _parse_decimal_int(ctx.value))
        if c == _SLASH:
            trans = ctx.immediate_transition(_number_slash_end_handler(c, ctx, trans))
        yield trans
    yield ctx.immediate_transition(_ZERO_START_TABLE[c](c, ctx))
762863
def reload(self):
        

        if not self.fd.closed: self.fd.close()

        self.fd = open(self.fd.name, 'r')
        self.load()
313324
def from_int(cls, retries, redirect=True, default=None):
        
        if retries is None:
            retries = default if default is not None else cls.DEFAULT

        if isinstance(retries, Retry):
            return retries

        redirect = bool(redirect) and None
        new_retries = cls(retries, redirect=redirect)
        log.debug("Converted retries value: %r -> %r" % (retries, new_retries))
        return new_retries
178374
def _crc32(self, ch, crc):
        """"""
        return ((crc >> 8) & 0xffffff) ^ self.crctable[(crc ^ ord(ch)) & 0xff]
16661
def reload_target!(options = {})
      old_options = @target_load_options || {}
      options = (@target_load_options || {}).merge(options)
      if options[:skip_first_time] && @target_load_count == 1
        @target_load_count += 1
      else
        load_target!(options.merge(reload: true))
      end
    end
997305
def check_and_reset(self, value=None):
    

    if self.check():
      self.reset(value)
      return True
    return False
963270
public void reset(int initialValue) throws FetchException, PersistException {
        synchronized (mStoredSequence) {
            Transaction txn = mRepository.enterTopTransaction(null);
            txn.setForUpdate(true);
            try {
                boolean doUpdate = mStoredSequence.tryLoad();
                mStoredSequence.setInitialValue(initialValue);
                // Start as small as possible to allow signed long comparisons to work.
                mStoredSequence.setNextValue(Long.MIN_VALUE);
                if (doUpdate) {
                    mStoredSequence.update();
                } else {
                    mStoredSequence.insert();
                }
                txn.commit();
                mHasReservedValues = false;
            } finally {
                txn.exit();
            }
        }
    }
310926
def rr(self, r):
        
        if self.C is None or not is_number(self.regs[r]):
            self.set(r, None)
            self.set_flag(None)
            return

        self.rrc(r)
        tmp = self.C
        v_ = self.getv(self.regs[r])
        self.C = v_ >> 7
        self.regs[r] = str((v_ & 0x7F) | (tmp << 7))
739595
def restart_with_reloader(self):
        
        while 1:
            _log("info", " * Restarting with %s" % self.name)
            args = _get_args_for_reloading()

            # a weird bug on windows. sometimes unicode strings end up in the
            # environment and subprocess.call does not like this, encode them
            # to latin1 and continue.
            if os.name == "nt" and PY2:
                new_environ = {}
                for key, value in iteritems(os.environ):
                    if isinstance(key, text_type):
                        key = key.encode("iso-8859-1")
                    if isinstance(value, text_type):
                        value = value.encode("iso-8859-1")
                    new_environ[key] = value
            else:
                new_environ = os.environ.copy()

            new_environ["WERKZEUG_RUN_MAIN"] = "true"
            exit_code = subprocess.call(args, env=new_environ, close_fds=False)
            if exit_code != 3:
                return exit_code
878498
def reload
      device = SimCtl.device(udid: udid)
      device.instance_variables.each do |ivar|
        instance_variable_set(ivar, device.instance_variable_get(ivar))
      end
    end
502096
@Override
    public void reinitValue(DataReader in, EntryValueShort value) throws IOException {
        value.reinit(in.readInt(),   /* array position */
                     in.readShort(), /* data value */
                     in.readLong()   /* SCN value */);
    }
1108373
def _return_retry_timer(self):
        '''
        
        '''
        msg = 'Minion return retry timer set to %s seconds'
        if self.opts.get('return_retry_timer_max'):
            try:
                random_retry = randint(self.opts['return_retry_timer'], self.opts['return_retry_timer_max'])
                retry_msg = msg % random_retry
                log.debug('%s (randomized)', msg % random_retry)
                return random_retry
            except ValueError:
                # Catch wiseguys using negative integers here
                log.error(
                    'Invalid value (return_retry_timer: %s or '
                    'return_retry_timer_max: %s). Both must be positive '
                    'integers.',
                    self.opts['return_retry_timer'],
                    self.opts['return_retry_timer_max'],
                )
                log.debug(msg, DEFAULT_MINION_OPTS['return_retry_timer'])
                return DEFAULT_MINION_OPTS['return_retry_timer']
        else:
            log.debug(msg, self.opts.get('return_retry_timer'))
            return self.opts.get('return_retry_timer')
1136660
def reload(self, reload_timeout=300, save_config=True, no_reload_cmd=False):
        
        begin = time.time()
        self._chain.target_device.clear_info()
        result = False
        try:
            result = self._chain.target_device.reload(reload_timeout, save_config, no_reload_cmd)

        except ConnectionStandbyConsole as exc:
            message = exc.message
            self.log("Active RP became standby: {}".format(message))
            self.disconnect()
            # self._conn_status.clear()
            result = self.reconnect()

        # connection error caused by device booting up
        except ConnectionError as exc:
            message = exc.message
            self.log("Connection error: {}".format(message))
            self.disconnect()
            result = self.reconnect()

        if result:
            elapsed = time.time() - begin
            self.emit_message("Target device reload last {:.0f}s.".format(elapsed), log_level=logging.INFO)
        else:
            self.emit_message("Target device not reloaded.", log_level=logging.ERROR)
        return result
685348
int refreshAndGetMin() {
		int min = Integer.MAX_VALUE;

		Collection<InputChannel> channels = inputGate.getInputChannels().values();

		for (InputChannel channel : channels) {
			if (channel instanceof RemoteInputChannel) {
				RemoteInputChannel rc = (RemoteInputChannel) channel;

				int size = rc.unsynchronizedGetNumberOfQueuedBuffers();
				min = Math.min(min, size);
			}
		}

		if (min == Integer.MAX_VALUE) { // in case all channels are local, or the channel collection was empty
			return 0;
		}
		return min;
	}