the last block completely.
186050
private boolean discardDone(INodeFileUnderConstruction pendingFile,
                              String src) throws IOException {
    Block[] blocks = pendingFile.getBlocks();
    if (blocks == null || blocks.length == 0) {
      return false;
    }
    Block last = blocks[blocks.length-1];
    if (last.getNumBytes() == 0) {
      dir.removeBlock(src, pendingFile, last);
      finalizeINodeFileUnderConstruction(src, pendingFile);
      NameNode.stateChangeLog.warn("BLOCK*" +
          " internalReleaseLease: discarded last block " + last +
          " , lease removed for " +  src);
      return true;
    }
    return false;
  }
1105380
def position_at_end(self, block):
        
        self._block = block
        self._anchor = len(block.instructions)
1166405
public synchronized void complete() {
        if( logger.isInfoEnabled() ) {
            logger.info("[" + this + "] Marking complete");
        }
        if( loaded ) {
            return;
        }
        loaded = true;
        lastTouch = System.currentTimeMillis();
        if( waiting != null && waiting.isEmpty() ) {
            waiting = null;
        }
        notifyAll();
    }
416289
function(block, line_number) {
  var b = block;
  var last_list = null;
  do {
    if (b.t === 'List') {
      last_list = b;
    }
    b = b.parent;
  } while (b);

  if (last_list) {
    while (block != last_list) {
      this.finalize(block, line_number);
      block = block.parent;
    }
    this.finalize(last_list, line_number);
    this.tip = last_list.parent;
  }
}
523583
public void finishSynch() throws IOException {
		if (finishing != null) {
			finishing.blockException(0);
			return;
		}
		finishing = new SynchronizationPoint<>();
		try {
			AsyncWork<Integer, IOException> lastWrite = writeOps.getLastPendingOperation();
			if (lastWrite != null) {
				lastWrite.blockException(0);
			}
			deflater.finish();
			if (!deflater.finished()) {
				byte[] writeBuf = new byte[8192];
				do {
					int nb = deflater.deflate(writeBuf, 0, writeBuf.length);
					if (nb <= 0) break;
					output.writeSync(ByteBuffer.wrap(writeBuf, 0, nb));
				} while (!deflater.finished());
			}
			finishing.unblock();
		} catch (IOException e) {
			finishing.error(e);
			throw e;
		}
	}
706466
def last(self):
        """"""
        with self.lock:
            try:
                return self.data[-1][0]
            except IndexError as ex:
                ex.args = ('DEPQ is empty',)
                raise
304850
def setPieceCompleted(pieceIndex, bool)
      eachBlockInPiece(pieceIndex) do |blockIndex|
        if bool
          @completeBlocks.set blockIndex
        else
          @completeBlocks.clear blockIndex
        end
      end
      if bool
        @completePieces.set pieceIndex
      else
        @completePieces.clear pieceIndex
      end
    end
41959
def complete(self):
        
        return self.valid and (self.access_token or self.refresh_token or self.type == 2)
1328754
protected boolean completeAppend(boolean succeeded, long lastLogIndex, CompletableFuture<AppendResponse> future) {
    future.complete(logResponse(AppendResponse.builder()
        .withStatus(RaftResponse.Status.OK)
        .withTerm(raft.getTerm())
        .withSucceeded(succeeded)
        .withLastLogIndex(lastLogIndex)
        .build()));
    return succeeded;
  }
175731
def clear(self, startBlock, endBlock):
        
        for block in qutepart.iterateBlocksFrom(startBlock):
            self._setBlockMarked(block, False)
            if block == endBlock:
                break
1149571
public function endBlock()
    {
        if (!$this->openBlocks) {
            throw new RuntimeException('No block started.');
        }

        $name  = array_pop($this->openBlocks);
        $value = ob_get_clean();

        if ($this->blocks[$name] === null) {
            $this->blocks[$name] = $value;
        }

        return $this->blocks[$name];
    }
297138
def commit_finished( self, block_id ):
        

        self.db.commit()

        # NOTE: tokens vest for the *next* block in order to make the immediately usable
        assert block_id+1 in self.vesting, 'BUG: failed to vest at {}'.format(block_id)

        self.clear_collisions( block_id )
        self.clear_vesting(block_id+1)
792287
private void finishCompletion() {
        // assert state > COMPLETING;
        for (WaitNode q; (q = waiters) != null;) {
            if (U.compareAndSwapObject(this, WAITERS, q, null)) {
                for (;;) {
                    Thread t = q.thread;
                    if (t != null) {
                        q.thread = null;
                        LockSupport.unpark(t);
                    }
                    WaitNode next = q.next;
                    if (next == null)
                        break;
                    q.next = null; // unlink to help gc
                    q = next;
                }
                break;
            }
        }

        done();

        callable = null;        // to reduce footprint
    }
349139
public void complete()
    {
        completeTree();

        StageManager.getStage(Stage.ANTI_ENTROPY).execute(this);

        if (logger.isDebugEnabled())
        {
            // log distribution of rows in tree
            logger.debug("Validated {} partitions for {}.  Partitions per leaf are:", validated, desc.sessionId);
            tree.histogramOfRowCountPerLeaf().log(logger);
            logger.debug("Validated {} partitions for {}.  Partition sizes are:", validated, desc.sessionId);
            tree.histogramOfRowSizePerLeaf().log(logger);
        }
    }
998191
def _find_complete_block_bounds(self, table, used_cells, possible_block_start,
                                    start_pos, end_pos):
        '''
        
        '''
        block_start = list(possible_block_start)
        block_end = list(possible_block_start)
        table_row = table[block_start[0]]
        used_row = used_cells[block_start[0]]
        # Find which column the titles end on
        for column_index in range(block_start[1], end_pos[1]+1):
            # Ensure we catch the edge case of the data reaching the edge of
            # the table -- block_end should then equal end_pos
            block_end[1] = max(block_end[1], column_index)
            if (column_index == end_pos[1] or used_row[column_index] or
                    is_empty_cell(table_row[column_index])):
                break
        for row_index in range(block_start[0]+1, end_pos[0]+1):
            block_end[0] = row_index
            # Stop if we reach the end of the table space
            if block_end[0] == end_pos[0]:
                break
            table_row = table[row_index]
            blank = False
            for column_index in range(block_start[1], block_end[1]):
                if (column_index == block_end[1] or used_row[column_index] or
                        is_empty_cell(table_row[column_index])):
                    blank = True
                    break
            if blank:
                break
        return block_start, block_end
536572
private void setLastCompleted(long lastCompleted) {
    if (!log.isOpen())
      return;

    this.lastCompleted = Math.max(this.lastCompleted, lastCompleted);

    // Update the log compaction minor index.
    log.compactor().minorIndex(this.lastCompleted);

    completeSnapshot();
  }
1331458
private void complete(KSplit split, KCall call) {
		reset(call.getProcess());
		split.split(call);
	}