Finalize internal data structure after all the states and transitions have been added.
345939
public void finishDefinition(){
		sequencer = null;
		states = ImmutableBiMap.copyOf(states);
		Map<S, Set<T>> validTransitionsCopied = new HashMap<S, Set<T>>();
		for (Map.Entry<S, Set<T>> entry: validTransitions.entrySet()){
			validTransitionsCopied.put(entry.getKey(), ImmutableSet.copyOf(entry.getValue()));
		}
		validTransitions = ImmutableMap.copyOf(validTransitions);
	}
424611
public function finalize()
    {
        $this->addItem(new MainMenu());

        if (get_class(\Ease\Shared::user()) == 'SpojeNet\System\User') {
            $this->addItem(new History());
        }
    }
439988
public function finalize()
    {
        // Output our chunks.
        // Every output is split into 4 chunk strings (header, messages,
        // data, footer).
        foreach ($this->chunkStrings as $chunkString) {
            // Save everything to the file after we are done.
            $this->pool->chunks->saveDechunkedToFile($chunkString);
        }
    }
979445
def after_processing(eng, objects):
        """"""
        super(InvenioProcessingFactory, InvenioProcessingFactory)\
            .after_processing(eng, objects)
        if eng.has_completed:
            eng.save(WorkflowStatus.COMPLETED)
        else:
            eng.save(WorkflowStatus.HALTED)
        db.session.commit()
1077628
private static void finish() {

		if (progress.getMax() != null) {

			StringBuilder output = new StringBuilder();
			output.append("\nTile Generation: ").append(progress.getProgress())
					.append(" of ").append(progress.getMax());

			if (geoPackage != null) {
				try {
					GeoPackageTextOutput textOutput = new GeoPackageTextOutput(
							geoPackage);
					output.append("\n\n");
					output.append(textOutput.header());
					output.append("\n\n");
					output.append(textOutput.tileTable(tileTable));

				} finally {
					geoPackage.close();
				}
			}

			System.out.println(output.toString());
		}
	}
776293
public void finishTransitionImmediately() {
    mTransitionState = TRANSITION_NONE;
    for (int i = 0; i < mLayers.length; i++) {
      mAlphas[i] = mIsLayerOn[i] ? 255 : 0;
    }
    invalidateSelf();
  }
278500
def _state_removal_init(self):
        """"""
        # First, we remove all multi-edges:
        for state_i in self.mma.states:
            for state_j in self.mma.states:
                if state_i.stateid == state_j.stateid:
                    self.l_transitions[
                        state_i.stateid, state_j.stateid] = self.epsilon
                else:
                    self.l_transitions[
                        state_i.stateid, state_j.stateid] = self.empty

                for arc in state_i.arcs:
                    if arc.nextstate == state_j.stateid:
                        if self.l_transitions[state_i.stateid, state_j.stateid] != self.empty:
                            self.l_transitions[state_i.stateid, state_j.stateid] \
                                += self.mma.isyms.find(arc.ilabel)
                        else:
                            self.l_transitions[state_i.stateid, state_j.stateid] = \
                                self.mma.isyms.find(arc.ilabel)
1112913
def finish_data(self, layers):
        
        for layer in layers:
            layer.data = self.facet.finish_data(layer.data, self)
1166905
def _finalize_hierarchy(self):
        
        if self.last_child:
            self.last_child.state_execution_status = StateExecutionStatus.INACTIVE

        if not self.backward_execution:
            if self.last_error:
                self.output_data['error'] = copy.deepcopy(self.last_error)
            self.write_output_data()
            self.check_output_data_type()
            self.execution_history.push_return_history_item(self, CallType.CONTAINER, self, self.output_data)
            # add error message from child_state to own output_data

        self.state_execution_status = StateExecutionStatus.WAIT_FOR_NEXT_STATE

        if self.preempted:
            self.final_outcome = Outcome(-2, "preempted")

        self.child_state = None
        self.last_child = None

        return self.finalize(self.final_outcome)
1049663
public function finalize()
    {
        if (!$this->finalized) {
            foreach ($this->getRoutes() as $route) {
                $route->finalize();
                $this->addRoute($route->getMethods(), $route->getPattern(), [$route, 'run']);
            }
            $this->finalized = true;
        }
    }
835246
def finalize_concurrency_state(self, outcome):
        
        final_outcome = outcome
        self.write_output_data()
        self.check_output_data_type()
        self.execution_history.push_return_history_item(self, CallType.CONTAINER, self, self.output_data)
        self.state_execution_status = StateExecutionStatus.WAIT_FOR_NEXT_STATE

        singleton.state_machine_execution_engine._modify_run_to_states(self)

        if self.preempted:
            final_outcome = Outcome(-2, "preempted")
        return self.finalize(final_outcome)
139299
def is_finalized(self):
        """"""

        return self.state == self.STATES.FINALIZED or self.state == self.STATES.INSTALLED
98327
def finalize(self):
        """"""
        print('{} default sprite names found:'.format(self.total_default))
        for name in self.list_default:
            print(name)
487518
public synchronized void finish() {
        if (!isFinished) {
            isFinished = true;
            try {
                writer.close();
                // Re-open as a random access file so we can overwrite the 3 int
                // header that specifies the number of dimensions and values.
                // Note that the location of the matrix data is dependent on
                // whether the matrix is to be transposed.
                RandomAccessFile matrixRaf =
                    new RandomAccessFile(matrixFile, "rw");

                // Write the header in the first 100 characters.  The header is
                // the number rows, the number of columns, and the number of non
                // zeros on a single line with spaces between them.
                StringBuilder sb = new StringBuilder();
                sb.append(curRow).append(" ");
                sb.append(numCols).append(" ");
                sb.append(nonZeroValues).append(" ");
                matrixRaf.write(sb.toString().getBytes());
            } catch (IOException ioe) {
                throw new IOError(ioe);
            }
        }
    }
1323209
private void finalizeCEs() {
        CollationDataBuilder newBuilder = new CollationDataBuilder();
        newBuilder.initForTailoring(baseData);
        CEFinalizer finalizer = new CEFinalizer(nodes.getBuffer());
        newBuilder.copyFrom(dataBuilder, finalizer);
        dataBuilder = newBuilder;
    }
949917
def finalize(self):
        '''
        
        '''
        self._condition.acquire()
        try:
            if self._nconnections != len(self._pool):
                warnings.warn('finalize() called with unreleased connections', RuntimeWarning, 2)

            while self._pool:
                self._close(self._pool.pop().connection)
            self._nconnections = 0
        finally:
            self._condition.release()
274525
void finalizeJobStateBeforeCommit() {
    this.jobState.setEndTime(System.currentTimeMillis());
    this.jobState.setDuration(this.jobState.getEndTime() - this.jobState.getStartTime());

    for (TaskState taskState : this.jobState.getTaskStates()) {
      // Set fork.branches explicitly here so the rest job flow can pick it up
      this.jobState
          .setProp(ConfigurationKeys.FORK_BRANCHES_KEY, taskState.getPropAsInt(ConfigurationKeys.FORK_BRANCHES_KEY, 1));
    }
  }