Before the end of book generation
965127
function() {
            // NOTE: This fixed issue #7
            // https://github.com/vowstar/gitbook-plugin-uml/issues/7
            // HTML will load after this operation
            // Copy images to output folder every time
            var book = this;
            var output = book.output;
            var rootPath = output.root();
            if (fs.existsSync(ASSET_PATH)) {
                fs.mkdirs(path.join(rootPath, ASSET_PATH));
                fs.copySync(ASSET_PATH, path.join(rootPath, ASSET_PATH));
            }
        }
1094243
public function endWrite()
    {
        if (false !== $this->firstHarvestedId) {
            $this->saveFile(
                $this->firstHarvestedId, $this->getCombinedXML($this->innerXML)
            );
        }

        if (!empty($this->deletedIds)) {
            $this->saveDeletedRecords($this->deletedIds);
        }
    }
1129191
function encodeBookWithPage(book, page) {
    var file = page.getFile();

    var result = encodeBook(book);
    result.page = encodePage(page, book.getSummary());
    result.file = encodeFile(file);

    return result;
}
718915
def _endGenresNode(self, name, content):
        """"""

        if name == 'class':
            self._genre = content
        elif name == 'relevance':
            self._relevance = content
        elif name == 'genre':
            if not self._error:
                self._importer.new_genre(self._programId, self._genre,
                                        self._relevance)
1151375
void endFinalizerGaps(Env<GenContext> from, Env<GenContext> to) {
        Env<GenContext> last = null;
        while (last != to) {
            endFinalizerGap(from);
            last = from;
            from = from.next;
        }
    }
1003279
def end_of_history(self, current): # (M->)
        '''
        self.history_cursor = len(self.history)
        current.set_line(self.history[-1].get_line_text())
1336412
private void replaceWithFinishedReaders(List<SSTableReader> finished)
    {
        if (isOffline)
        {
            for (SSTableReader reader : discard)
            {
                if (reader.getCurrentReplacement() == reader)
                    reader.markObsolete();
                reader.selfRef().release();
            }
        }
        else
        {
            dataTracker.replaceEarlyOpenedFiles(discard, finished);
            dataTracker.unmarkCompacting(discard);
        }
        discard.clear();
    }
1116335
public function beforeGenerate() {
    $this->writeln('<?php');
    $this->writeln(
      '# Generated by mfn/php-reflection-gen ' . Reflector::VERSION);
    $this->writeln('# PHP Version ' . phpversion());
  }
505820
public function onBeforePublish()
    {
        /**
         * @var DBDatetime $publishDate
         */
        $publishDate = $this->dbObject('PublishDate');

        if (!$publishDate->getValue()) {
            $this->PublishDate = DBDatetime::now()->getValue();
            $this->write();
        }
    }
471350
private void addBook(String isbn, String title, String synopsis, int quantity) {
        Book book = new Book();
        book.setIsbn(isbn);
        book.setTitle(title);
        book.setSynopsis(synopsis);
        isbns_to_books.put(isbn, book);
        isbns_to_quantities.put(isbn, quantity);
    }
250859
function( node ) {
			this.optimizeBookmark();
			this.trim( false, true );

			var startContainer = this.startContainer;
			var startOffset = this.startOffset;

			var nextNode = startContainer.getChild( startOffset );

			if ( nextNode )
				node.insertBefore( nextNode );
			else
				startContainer.append( node );

			// Check if we need to update the end boundary.
			if ( node.getParent() && node.getParent().equals( this.endContainer ) )
				this.endOffset++;

			// Expand the range to embrace the new node.
			this.setStartBefore( node );
		}
553347
def end_document implicit_end = !streaming?
      @last.implicit_end = implicit_end
      n = pop
      set_end_location(n)
      n
    end
253391
def _page_gen(self):
        
        track = ""
        for page in self.__pages__:
            track += "/{page}".format(page=page)
        return track
348230
def previous_pages_numbers(self):
        ''
        count = self._previous_pages_count() + 1
        for i in reversed(range(1, count)):
            yield i
241199
function end() {
		var err
		var args = Array.prototype.slice.call(arguments)
		var cb = typeof args[args.length - 1] === 'function' ? args.pop() : null
		if (self.writable && args.length) write.apply(this, args.concat(afterWrite))
		else afterWrite()

		function afterWrite(e) {
			if (e) err = e
			destroy(afterDestroy)
		}

		function afterDestroy(e) {
			if (e && !err) err = e
			if (cb) {
				var cbArgs = []
				if (err) cbArgs.push(err)
				cb.apply(this, cbArgs)
			}
		}
	}
484888
def compute_before_after(self):
        
        if not self.parsed:
            self._parse()
        list_from = self.input_lines
        list_to = []
        last = 0
        for e in self.docs_list:
            start, end = e['location']
            if start <= 0:
                start, end = -start, -end
                list_to.extend(list_from[last:start + 1])
            else:
                list_to.extend(list_from[last:start])
            docs = e['docs'].get_raw_docs()
            list_docs = [l + '\n' for l in docs.splitlines()]
            list_to.extend(list_docs)
            last = end + 1
        if last < len(list_from):
            list_to.extend(list_from[last:])

        return list_from, list_to
60524
def mid_generate(self):
        """"""
        self.last_mid += 1
        if self.last_mid == 0:
            self.last_mid += 1
        return self.last_mid