Finish batch.

This function is a static function to avoid serializing the ConfigSync
object unnecessarily.
5109
public static function finishBatch($success, $results, $operations) {
    if ($success) {
      if (!empty($results['errors'])) {
        foreach ($results['errors'] as $error) {
          drupal_set_message($error, 'error');
          \Drupal::logger('config_sync')->error($error);
        }
        drupal_set_message(t('The configuration was imported with errors.'), 'warning');
      }
      else {
        drupal_set_message(t('The configuration was imported successfully.'));
      }
    }
    else {
      // An error occurred.
      // $operations contains the operations that remained unprocessed.
      $error_operation = reset($operations);
      $message = t('An error occurred while processing %error_operation with arguments: @arguments', [
        '%error_operation' => $error_operation[0],
        '@arguments' => print_r($error_operation[1], TRUE),
      ]);
      drupal_set_message($message, 'error');
    }

    $redirect_url = Url::fromRoute(self::DASHBOARD)
      ->setAbsolute()
      ->toString();
    return new RedirectResponse($redirect_url);
  }
319949
def finish(self):
        
        chunks = []
        while lib.BrotliEncoderIsFinished(self._encoder) == lib.BROTLI_FALSE:
            chunks.append(self._compress(b'', lib.BROTLI_OPERATION_FINISH))

        return b''.join(chunks)
330140
public void finish() {

		try {

			FileChannel channel = getChannel(false);

			if (channel != null && channel.isOpen()) {

				channel.force(true);
				channel.close();

				this.privateFileChannel = null;

				//file.increaseVersion();
				file.notifyUploadCompletion();
			}

		} catch (IOException e) {

			logger.warn("Unable to finish file upload", e);
		}
	}
237075
public function endingTask()
    {
        $this->alert("Successfully Create ".$this->vendor.'/'.$this->package." Package");
        $this->comment(str_repeat('*', 65));
        $this->comment('  Package: '.$this->package);
        $this->output->writeln('');
        $this->line('  Namespace: '.htmlentities($this->namespace));
        $this->output->writeln('');
        $this->comment('  Path Location: '.$this->path);
        $this->comment(str_repeat('*', 65));
        $this->output->writeln('');
        $this->alert("Run: composer dump-autoload");
    }
339000
def finish(self):
        ''

        self.finished = True
        self.update(self.maxval)
        self.fd.write('\n')
        if self.signal_set:
            signal.signal(signal.SIGWINCH, signal.SIG_DFL)
1246378
public void finish() {
        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE))  //306998.15
            logger.entering(CLASS_NAME,"finish","["+this+"]");

        if (!isCommitted()) {
            commit();
        }

        // flush the OutputStream and Writer
        try {
            flushBuffer(false);
            _rawOut.close();
        }
        catch (IOException e) {
            // Don't want to report errors on early browser closes
            if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) {  //306998.15
                logger.logp(Level.FINE, CLASS_NAME,"finish", "Servlet.Exception:.Error.while.finishing.response", e);
            }
        }
        finally {
            _rawOut.reset();
            // PK29451 - remove call to clearHeaders(). Implementation of clearHeaders() was empty,
            // which this method relies on, but has been implemented in PK29451 to make reset() work.
            // _response.clearHeaders();
            
            cleanupFromFinish();
            // LIBERTY _bufferedOut.reset();
            _bufferedWriter.reset();
            // LIBERTY this._responseBuffer = null;
        }

        resetState();

        if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE))  //306998.15
            logger.exiting(CLASS_NAME,"finish");
    }
1152401
def finish(self):
        
        super(InterruptibleMixin, self).finish()
        signal(SIGINT, self.original_handler)
461332
def finish(self):
        """"""
        self._my_map['over'] = True  # finished == over?
        self._my_map['completionTime'] = DateTime.utcnow()
        self._save()
558374
public static void endDoing() {
    long elapsed = System.currentTimeMillis() - startTime;
    System.err.println("done [" + nf.format(((double) elapsed) / 1000) + 
                       " sec].");
  }
723899
def write_batch(self, batch):
        
        for item in batch:
            for key in item:
                self.aggregated_info['occurrences'][key] += 1
            self.increment_written_items()
            if self.items_limit and self.items_limit == self.get_metadata('items_count'):
                raise ItemsLimitReached('Finishing job after items_limit reached: {} items written.'
                                        .format(self.get_metadata('items_count')))
        self.logger.debug('Wrote items')
1176015
function finish(err) {
      // Run callbacks when we have an error,
      // or when import parsing is complete.
      if (err || self.isParsed()) {
        // Cache the file after parsing:
        _.cacheFile(self);

        // Run all callbacks:
        for (var i=0; i < self._cb.length; i++) self._cb[i](err, self);
        self._cb = [];
      }
    }
421651
def finish(self):
        ''''''
        self.ibd.close()
        self._write_xml()
        self.xml.close()
592878
function done() {
      res.removeListener('finish', onfinish);
      res.removeListener('close', onclose);
      /* eslint no-underscore-dangle: 0 no-param-reassign: 0 */
      ctx.response._startAt = process.hrtime();
      try {
        const line = formatLine(morgan, ctx);
        /* eslint no-console:0 */
        console.info(line);
      } catch (err) {
        /* eslint no-console:0 */
        /* istanbul ignore next */
        console.error(err);
      }
    }
172171
def finish():
    # type: () -> None
    
    pretend = context.get('pretend', False)

    if not pretend and (git.staged() or git.unstaged()):
        log.err(
            "You have uncommitted changes in your repo!\n"
            "You need to stash them before you merge the hotfix branch"
        )
        sys.exit(1)

    branch = git.current_branch(refresh=True)
    base = common.get_base_branch()

    prompt = "<32>Merge <33>{}<32> into <33>{}<0>?".format(branch.name, base)
    if not click.confirm(shell.fmt(prompt)):
        log.info("Cancelled")
        return

    common.assert_branch_type('task')

    # Merge task into it's base feature branch
    common.git_checkout(base)
    common.git_pull(base)
    common.git_merge(base, branch.name)

    # Cleanup
    common.git_branch_delete(branch.name)
    common.git_prune()

    common.git_checkout(base)
241859
def finalize(self):
        
        # todo sort self.result by path_num
        if self.result:
            self.result = sorted(self.result, key=lambda x: x[0])
            p, r = map(list, zip(*self.result))
            self.result = r
673760
public function finish()
    {
        if (!empty($this->queue)) {
            // empty queue to avoid duplicates
            $queue = $this->queue;
            $this->queue = array();
            $this->sendChunk($queue);
        }
    }
681
private void finishTask(TaskControllerContext context,
      TaskCommands command) throws IOException{
    if(context.task == null) {
      LOG.info("Context task null not killing the JVM");
      return;
    }
    ShellCommandExecutor shExec = buildTaskControllerExecutor(
        command, context.env.conf.getUser(), 
        buildKillTaskCommandArgs(context), context.env.workDir,
        context.env.env);
    try {
      shExec.execute();
    } catch (Exception e) {
      LOG.warn("Output from task-contoller is : " + shExec.getOutput());
      throw new IOException(e);
    }
  }