finalize for ConsumerConsumer
180231
def finalize(self):
        """"""
        for c in self.consumers:
            c.finalize()
        self.result = [c.result for c in self.consumers]
54755
public void setCachedConsumer(CATMainConsumer consumer)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setCachedConsumer", consumer);
        this.cachedConsumer = consumer;
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setCachedConsumer");
    }
853328
public void closeConsumers() {
        final List<RowProcessingConsumer> configurableConsumers = getConfigurableConsumers();
        final TaskRunner taskRunner = _publishers.getTaskRunner();
        for (RowProcessingConsumer consumer : configurableConsumers) {
            TaskRunnable task = createCloseTask(consumer, null);
            taskRunner.run(task);
        }
    }
702822
async def finalize_request(
        self,
        result: ResponseReturnValue,
        request_context: Optional[RequestContext]=None,
        from_error_handler: bool=False,
    ) -> Response:
        
        response = await self.make_response(result)
        try:
            response = await self.process_response(response, request_context)
            await request_finished.send(self, response=response)
        except Exception:
            if not from_error_handler:
                raise
            self.logger.exception('Request finalizing errored')
        return response
130865
private void finalizePromotion() {
        NodeEngine nodeEngine = getNodeEngine();
        InternalPartitionServiceImpl partitionService = getService();
        OperationService operationService = nodeEngine.getOperationService();

        partitionState.setMaster(getCallerAddress());
        success = partitionService.processPartitionRuntimeState(partitionState);

        ILogger logger = getLogger();
        if (!success) {
            logger.severe("Promotion of " + promotions.size() + " partitions failed. "
                    + ". Promotion partition state version: " + partitionState.getVersion()
                    + ", current partition state version: " + partitionService.getPartitionStateVersion());
        }
        if (logger.isFineEnabled()) {
            logger.fine("Submitting FinalizePromotionOperations for " + promotions.size() + " promotions. Result: " + success
                    + ". Promotion partition state version: " + partitionState.getVersion()
                    + ", current partition state version: " + partitionService.getPartitionStateVersion());
        }
        for (MigrationInfo promotion : promotions) {
            if (logger.isFinestEnabled()) {
                logger.finest("Submitting FinalizePromotionOperation for promotion: " + promotion + ". Result: " + success);
            }
            FinalizePromotionOperation op = new FinalizePromotionOperation(promotion, success);
            op.setPartitionId(promotion.getPartitionId()).setNodeEngine(nodeEngine).setService(partitionService);
            operationService.execute(op);
        }
        partitionService.getInternalMigrationListener()
                .onPromotionComplete(MigrationParticipant.DESTINATION, promotions, success);
        partitionService.getMigrationManager().releasePromotionPermit();
    }
1149317
@Override
  public Object finalizeComputation(Object object)
  {
    if (shouldFinalize) {
      SketchHolder holder = (SketchHolder) object;
      if (errorBoundsStdDev != null) {
        return holder.getEstimateWithErrorBounds(errorBoundsStdDev);
      } else {
        return holder.getEstimate();
      }
    } else {
      return object;
    }
  }
1065065
public function finalize()
    {
        foreach ($this->getGroups() as $group) {
            foreach ($group->getMiddleware() as $middleware) {
                array_unshift($this->middleware, $middleware);
            }
        }
        foreach ($this->getMiddleware() as $middleware) {
            $this->addMiddleware($middleware);
        }
    }
1089855
def finalize(self):
        
        self.spinBox.valueChanged.disconnect(self.commitChangedValue)
        super(FloatCtiEditor, self).finalize()
504004
def finalize_path(self, path_num=None):
        """"""
        for c in self.consumers:
            c.finalize_path(path_num)
        self.result = [c.result for c in self.consumers]
424611
public function finalize()
    {
        $this->addItem(new MainMenu());

        if (get_class(\Ease\Shared::user()) == 'SpojeNet\System\User') {
            $this->addItem(new History());
        }
    }
1310113
def _finalize():
    """"""
    from .memory import MemBlock
    from pyrtl.corecircuits import select
    for lhs in _predicate_map:
        # handle memory write ports
        if isinstance(lhs, MemBlock):
            p, (addr, data, enable) = _predicate_map[lhs][0]
            combined_enable = select(p, truecase=enable, falsecase=Const(0))
            combined_addr = addr
            combined_data = data

            for p, (addr, data, enable) in _predicate_map[lhs][1:]:
                combined_enable = select(p, truecase=enable, falsecase=combined_enable)
                combined_addr = select(p, truecase=addr, falsecase=combined_addr)
                combined_data = select(p, truecase=data, falsecase=combined_data)

            lhs._build(combined_addr, combined_data, combined_enable)

        # handle wirevector and register assignments
        else:
            if isinstance(lhs, Register):
                result = lhs  # default for registers is "self"
            elif isinstance(lhs, WireVector):
                result = 0  # default for wire is "0"
            else:
                raise PyrtlInternalError('unknown assignment in finalize')
            predlist = _predicate_map[lhs]
            for p, rhs in predlist:
                result = select(p, truecase=rhs, falsecase=result)
            lhs._build(result)
12484
def consumer(function):
    """"""
    @wraps(function)
    def wrapper(*args, **kwargs):
        generator = function(*args, **kwargs)
        next(generator)
        return generator
    return wrapper
410297
private static <T> BiConsumer<T, Throwable> completeHandler(CompletableCompletionStage<T> s) {
        return (result, failure) -> {
            if (failure == null) {
                s.complete(result);
            } else {
                handleFailure(s, failure);
            }
        };
    }
1142653
def _cleanup(self):
        '''
        
        '''
        self._pending_consumers = None
        self._consumer_cb = None
        self._get_cb = None
        self._recover_cb = None
        self._cancel_cb = None
        self._return_listener = None
        super(BasicClass, self)._cleanup()
111555
def finalize(self):
        
        logger.debug("Finalizing: {}".format(self))
        self.plotItem.scene().sigMouseMoved.disconnect(self.mouseMoved)
        self.plotItem.close()
        self.graphicsLayoutWidget.close()
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()
700274
private void bodyConsumerFinish() {
    BodyConsumer consumer = bodyConsumer;
    bodyConsumer = null;
    try {
      consumer.finished(responder);
    } catch (Throwable t) {
      exceptionHandler.handle(t, request, responder);
    }
  }