Last pairing step.
969432
def step4(self, encrypted_data):
        """"""
        chacha = chacha20.Chacha20Cipher(self._session_key, self._session_key)
        decrypted_tlv_bytes = chacha.decrypt(
            encrypted_data, nounce='PS-Msg06'.encode())
        if not decrypted_tlv_bytes:
            raise Exception('data decrypt failed')  # TODO: new exception
        decrypted_tlv = tlv8.read_tlv(decrypted_tlv_bytes)
        _LOGGER.debug('PS-Msg06: %s', decrypted_tlv)

        atv_identifier = decrypted_tlv[tlv8.TLV_IDENTIFIER]
        atv_signature = decrypted_tlv[tlv8.TLV_SIGNATURE]
        atv_pub_key = decrypted_tlv[tlv8.TLV_PUBLIC_KEY]
        log_binary(_LOGGER,
                   'Device',
                   Identifier=atv_identifier,
                   Signature=atv_signature,
                   Public=atv_pub_key)

        # TODO: verify signature here

        return Credentials(atv_pub_key, self._signing_key.to_seed(),
                           atv_identifier, self.pairing_id)
1133575
def finalize
      delta = @config[:block_reward] + @config[:nephew_reward] * uncles.size

      delta_balance coinbase, delta
      self.ether_delta += delta

      uncles.each do |uncle|
        r = @config[:block_reward] * (@config[:uncle_depth_penalty_factor] + uncle.number - number) / @config[:uncle_depth_penalty_factor]

        delta_balance uncle.coinbase, r
        self.ether_delta += r
      end

      commit_state
    end
903880
def ustep(self):
        """"""

        self.U += self.rsdl_r(self.AX, self.Y)
1243836
def finish(self):
        
        os.system('setterm -cursor on')
        if self.nl:
            Echo(self.label).done()
468967
def merge_and_fit(self, track, pairings):
        

        for (self_seg_index, track_seg_index, _) in pairings:
            self_s = self.segments[self_seg_index]
            ss_start = self_s.points[0]
            track_s = track.segments[track_seg_index]
            tt_start = track_s.points[0]
            tt_end = track_s.points[-1]

            d_start = ss_start.distance(tt_start)
            d_end = ss_start.distance(tt_end)

            if d_start > d_end:
                track_s = track_s.copy()
                track_s.points = list(reversed(track_s.points))

            self_s.merge_and_fit(track_s)
        return self
1221641
private function step2b()
    {
        // é   ée   ées   és   èrent   er   era   erai   eraIent   erais   erait   eras   erez   eriez   erions   erons   eront   ez   iez
        //      delete
        if ( ($position = $this->searchIfInRv(array(
            'ées', 'èrent', 'erais', 'erait', 'erai', 'eraIent', 'eras', 'erez', 'eriez',
            'erions', 'erons', 'eront', 'era', 'er', 'iez', 'ez','és', 'ée', 'é'))) !== false) {

            $this->word = Utf8::substr($this->word, 0, $position);

            return true;
        }

        // âmes   ât   âtes   a   ai   aIent   ais   ait   ant   ante   antes   ants   as   asse   assent   asses   assiez   assions
        //      delete
        //      if preceded by e, delete
        if ( ($position = $this->searchIfInRv(array(
            'âmes', 'âtes', 'ât', 'aIent', 'ais', 'ait', 'antes', 'ante', 'ants', 'ant',
            'assent', 'asses', 'assiez', 'assions', 'asse', 'as', 'ai', 'a'))) !== false) {

            $before = $position - 1;
            $letter = Utf8::substr($this->word, $before, 1);
            if ( $this->inRv($before) && ($letter == 'e') ) {
                $this->word = Utf8::substr($this->word, 0, $before);

            } else {
                $this->word = Utf8::substr($this->word, 0, $position);
            }

            return true;
        }

        // ions
        //      delete if in R2
        if ( ($position = $this->searchIfInRv(array('ions'))) !== false) {
            if ($this->inR2($position)) {
                $this->word = Utf8::substr($this->word, 0, $position);
            }

            return true;
        }

        return false;
    }
1182040
private void endPerformanceSnapshot() {
        // Stop the timing. This must be done first before any other counting is
        // stopped.
        mSnapshotCpuTime = Process.getElapsedCpuTime() - mSnapshotCpuTime;
        mSnapshotExecTime = SystemClock.uptimeMillis() - mSnapshotExecTime;

        stopAllocCounting();

        long nativeMax = Debug.getNativeHeapSize() / 1024;
        long nativeAllocated = Debug.getNativeHeapAllocatedSize() / 1024;
        long nativeFree = Debug.getNativeHeapFreeSize() / 1024;

        Debug.MemoryInfo memInfo = new Debug.MemoryInfo();
        Debug.getMemoryInfo(memInfo);

        Runtime runtime = Runtime.getRuntime();

        long dalvikMax = runtime.totalMemory() / 1024;
        long dalvikFree = runtime.freeMemory() / 1024;
        long dalvikAllocated = dalvikMax - dalvikFree;

        // Add final binder counts
        Bundle binderCounts = getBinderCounts();
        for (String key : binderCounts.keySet()) {
            mPerfSnapshot.putLong(key, binderCounts.getLong(key));
        }

        // Add alloc counts
        Bundle allocCounts = getAllocCounts();
        for (String key : allocCounts.keySet()) {
            mPerfSnapshot.putLong(key, allocCounts.getLong(key));
        }

        mPerfSnapshot.putLong(METRIC_KEY_EXECUTION_TIME, mSnapshotExecTime);
        mPerfSnapshot.putLong(METRIC_KEY_CPU_TIME, mSnapshotCpuTime);

        mPerfSnapshot.putLong(METRIC_KEY_NATIVE_SIZE, nativeMax);
        mPerfSnapshot.putLong(METRIC_KEY_NATIVE_ALLOCATED, nativeAllocated);
        mPerfSnapshot.putLong(METRIC_KEY_NATIVE_FREE, nativeFree);
        mPerfSnapshot.putLong(METRIC_KEY_NATIVE_PSS, memInfo.nativePss);
        mPerfSnapshot.putLong(METRIC_KEY_NATIVE_PRIVATE_DIRTY, memInfo.nativePrivateDirty);
        mPerfSnapshot.putLong(METRIC_KEY_NATIVE_SHARED_DIRTY, memInfo.nativeSharedDirty);

        mPerfSnapshot.putLong(METRIC_KEY_JAVA_SIZE, dalvikMax);
        mPerfSnapshot.putLong(METRIC_KEY_JAVA_ALLOCATED, dalvikAllocated);
        mPerfSnapshot.putLong(METRIC_KEY_JAVA_FREE, dalvikFree);
        mPerfSnapshot.putLong(METRIC_KEY_JAVA_PSS, memInfo.dalvikPss);
        mPerfSnapshot.putLong(METRIC_KEY_JAVA_PRIVATE_DIRTY, memInfo.dalvikPrivateDirty);
        mPerfSnapshot.putLong(METRIC_KEY_JAVA_SHARED_DIRTY, memInfo.dalvikSharedDirty);

        mPerfSnapshot.putLong(METRIC_KEY_OTHER_PSS, memInfo.otherPss);
        mPerfSnapshot.putLong(METRIC_KEY_OTHER_PRIVATE_DIRTY, memInfo.otherPrivateDirty);
        mPerfSnapshot.putLong(METRIC_KEY_OTHER_SHARED_DIRTY, memInfo.otherSharedDirty);
    }
243173
protected void finishCompoundMessage ()
    {
        if (--_compoundDepth == 0) {
            CompoundDownstreamMessage downstream = _compound;
            _compound = null;
            if (!downstream.msgs.isEmpty()) {
                postMessage(downstream, null);
            }
        }
    }
119601
private final void step3() {
        if (k == 0)
            return;
        /* For Bug 1 */
        switch (sb.charAt(k-1)) { 
        case 'a':
            if (ends("ational")) 
                r("ate");
            else if (ends("tional"))
                r("tion"); 
            break;
        case 'c':
            if (ends("enci")) 
                r("ence");
            else if (ends("anci")) 
                r("ance");
            break;
        case 'e':
            if (ends("izer")) 
                r("ize");
            break;
        case 'l':
            if (ends("bli"))
                r("ble");
            else if (ends("alli"))
                r("al");  
            else if (ends("entli"))
                r("ent"); 
            else if (ends("eli"))
                r("e");
            else if (ends("ousli"))
                r("ous");
            break; 
        case 'o':
            if (ends("ization")) 
                r("ize"); 
            else if (ends("ation")) 
                r("ate"); 
            else if (ends("ator"))
                r("ate");
            break;
        case 's':
            if (ends("alism")) 
                r("al"); 
            else if (ends("iveness")) 
                r("ive");
            else if (ends("fulness")) 
                r("ful"); 
            else if (ends("ousness")) 
                r("ous"); 
            break; 
        case 't': 
            if (ends("aliti")) 
                r("al"); 
            else if (ends("iviti"))
                r("ive");
            else if (ends("biliti")) 
                r("ble");
            break;
        case 'g':
            if (ends("logi")) 
                r("log");
            break;
        }
    }
1191246
def last(conf):
    """"""
    try:
        v2ex = V2ex(conf.config)
        v2ex.login()
        last_date = v2ex.get_last()
        click.echo(last_date)
    except KeyError:
        click.echo('Keyerror, please check your config file.')
    except IndexError:
        click.echo('Please check your username and password.')
1110841
def end(self, n=1, interval=0, pre_dl=None, post_dl=None):
        
        self.delay(pre_dl)
        self.k.tap_key(self.k.end_key, n, interval)
        self.delay(post_dl)
1088775
public void finish() {
        if ( finSignal == null && finished )
            return;
        // signal finish of execution, so remoting can clean up callback id mappings
        // override if always single result or finish can be emitted by the remote method
        // note one can send FINSILENT to avoid the final message to be visible to receiver callback/spore
        cb.complete(null, null);
        finished = true;
    }
632132
private function step3()
    {
        // leg   eleg   ig   eig   lig   elig   els   lov   elov   slov   hetslov
        if ( ($position = $this->searchIfInR1(array(
            'hetslov', 'eleg', 'elov', 'slov', 'elig', 'eig', 'lig', 'els', 'lov', 'leg', 'ig'
        ))) !== false) {
            $this->word = Utf8::substr($this->word, 0, $position);
        }
    }
1151375
void endFinalizerGaps(Env<GenContext> from, Env<GenContext> to) {
        Env<GenContext> last = null;
        while (last != to) {
            endFinalizerGap(from);
            last = from;
            from = from.next;
        }
    }
325566
def on_step_end(self, **kwargs):
        ""
        if not self.learn.gan_trainer.gen_mode: self.learn.opt.lr /= self.mult_lr
664602
private void step(String command, Socket socket, DataInputStream din) throws IOException {

        String actions = command.substring(stepTagLength, command.length() - (stepTagLength + 2));
        int options =  Character.getNumericValue(command.charAt(stepTagLength - 2));
        boolean withTurnkey = options < 2;
        boolean withInfo = options == 0 || options == 2;
        // TCPUtils.Log(Level.FINE,"Command (step action): " + actionCommand + " options " + options);

        byte[] stepTurnKey;
        if (withTurnkey) {
            int hdr;
            hdr = din.readInt();
            stepTurnKey = new byte[hdr];
            din.readFully(stepTurnKey);
        } else {
            stepTurnKey = new byte[0];
        }

        DataOutputStream dout = new DataOutputStream(socket.getOutputStream());
        double reward = 0.0;
        boolean done;
        byte[] obs;
        String info = "";
        byte[] currentTurnKey;
        byte[] nextTurnKey;
        boolean sent = false;

        lock.lock();
        try {

            done = envState.done;

            obs = getObservation(done);

            // If done or we have new observation and it's our turn then submit command and pick up rewards.

            currentTurnKey = envState.turnKey.getBytes();
            boolean outOfTurn = true;
            nextTurnKey = currentTurnKey;

            if (!done && obs.length > 0 && actions != "") {
                // CurrentKey   StepKey     Action (WithKey)    nextTurnKey     outOfTurn
                // ""           ""          Y                   Current         N
                // ""           X           N                   Step            Y
                // X            0           N                   Current         Y
                // X            X           Y (WK)              Current         N
                // X            Y           N                   Current         Y

                // TCPUtils.Log(Level.FINE, "current TK " + envState.turnKey + " step TK " + new String(stepTurnKey));
                if (currentTurnKey.length == 0) {
                    if (stepTurnKey.length == 0) {
                        if (actions.contains("\n")) {
                            String[] cmds = actions.split("\\n");
                            for(String cmd : cmds) {
                                envState.commands.add(cmd);
                            }
                        } else {
                            if (!actions.isEmpty())
                                envState.commands.add(actions);
                        }
                        outOfTurn = false;
                        sent = true;
                    } else {
                        nextTurnKey = stepTurnKey;
                    }
                } else {
                    if (stepTurnKey.length != 0) {
                        if (Arrays.equals(currentTurnKey, stepTurnKey)) {
                            // The step turn key may later still be stale when picked up from the command queue.
                            envState.commands.add(new String(stepTurnKey) + " " + actions);
                            outOfTurn = false;
                            envState.turnKey = "";
                            envState.lastTurnKey = new String(stepTurnKey);
                            sent = true;
                        }
                    }
                }
            }

            if (done || (obs.length > 0 && !outOfTurn)) {
                // Pick up rewards.
                reward = envState.reward;
                envState.reward = 0.0;
                if (withInfo) {
                    info = envState.info;
                    envState.info = "";
                    if (info.isEmpty() && !done) {
                        try {
                            cond.await(COND_WAIT_SECONDS, TimeUnit.SECONDS);
                        } catch (InterruptedException ie) {
                        }
                        info = envState.info;
                        envState.info = "";
                        if (envState.obs != null && envState.obs != obs) {
                            // Later observation.
                            obs = envState.obs;
                        }
                    }
                }
                envState.obs = null;
            }
        } finally {
            lock.unlock();
        }

        dout.writeInt(obs.length);
        dout.write(obs);

        dout.writeInt(BYTES_DOUBLE + 2);
        dout.writeDouble(reward);
        dout.writeByte(done ? 1 : 0);
        dout.writeByte(sent ? 1 : 0);

        if (withInfo) {
            byte[] infoBytes = info.getBytes(utf8);
            dout.writeInt(infoBytes.length);
            dout.write(infoBytes);
        }

        if (withTurnkey) {
            dout.writeInt(nextTurnKey.length);
            dout.write(nextTurnKey);
        }
        dout.flush();
    }
102335
public function last(): Pair
    {
        if ($this->isEmpty()) {
            throw new UnderflowException();
        }

        return $this->pairs[count($this->pairs) - 1];
    }