Called before a batch of entities is prepped for rendering
439141
function() {
        var gl = this.context;
        gl.useProgram(this.shader);
        gl.bindBuffer(gl.ARRAY_BUFFER, this._attributeBuffer);
        var a,
            attributes = this.attributes;
        // Process every attribute
        for (var i = 0; i < attributes.length; i++) {
            a = attributes[i];
            gl.vertexAttribPointer(
                a.location,
                a.width,
                a.type,
                false,
                this.stride * a.bytes,
                a.offset * a.bytes
            );
        }

        // For now, special case the need for texture objects
        var t = this.texture_obj;
        if (t && t.unit === null) {
            this.layer.texture_manager.bindTexture(t);
        }

        this.index_pointer = 0;
    }
1103283
def prepare(self, context):
        
        self.params = {}

        # no params, not even a newline
        if not self.nodelist:
            return

        # just static text, no vars, assume one TextNode
        if not self.nodelist.contains_nontext:
            text = self.nodelist[0].s.strip()

        # vars in params, we have to render
        else:
            context.push()
            context['object'] = self.obj
            text = self.nodelist.render(context)
            context.pop()

        if text:
            self.params = self.resolve_params(text)

        # override the default template from the parameters
        if 'template_name' in self.params:
            self.template_name = self.params['template_name']
923840
def render(self, context, db=None, safe_mode=False, extra_context=None):
        """"""
        if not db:
            raise MissingParameterError(
                "db",
                context=self.error_context
            )
        rendered_views = dict()
        path_instances = db.query(self.path.query, safe_mode=safe_mode)
        extra_ctx = copy(extra_context) if extra_context else dict()

        for inst in path_instances:
            extra_ctx.update({
                self.path.variable: inst
            })
            ctx = context.build(
                db=db,
                safe_mode=safe_mode,
                for_each_inst=inst,
                extra=extra_ctx
            )
            inst_path = self.path.render(inst=inst, context=ctx)
            rendered_view = self.template.render(ctx)
            rendered_views = deep_merge_dict(
                rendered_views,
                dict_from_path(inst_path, final_value=rendered_view)
            )
        return rendered_views
1190805
function(){
			var that = this;
		
			//render initial data
			if(this._initialRender){ this._initialRender(); }
			
			//called if the i-th object is successfully populated
			var populationSuccess = function(i){
				return function(){
					//after population work
					that._renderAfterItemPopulation(i);
					
					//stop indicator
					if (that.progressIndicators[i]) {
						that.progressIndicators[i].stop();
					}
				};
			};
			
			//called if the i-th object could not be successfully populated
			var populationFailure = function(i){
				return function(resp){
					if(that._errorHandler) { that._errorHandler(i, resp); }
					else { throw new Error(resp); }
				};
			};
			
			for(var i=0; i<this._model.getObjects().length; i++){
				//before population render work
				this._renderBeforeItemPopulation(i);
				
				//start indicator
				if (this.progressIndicators[i]) {
					this.progressIndicators[i].start();
				}
				
				//population
				this._model.getDetails(i).then(
					populationSuccess(i), populationFailure(i)
				);
			}
			
			//cleanup render work
			if(this._cleanupRender) { this._cleanupRender(); }
		}
172352
private function preBindDoctrineEvent() : void
    {
        if(EventScheduler::instance()->has(Event::DATA_CHANGED)){
            $this->getEventManager()->addEventListener([Events::postPersist, Events::postUpdate, Events::postRemove], new Class{
                public function postPersist(LifecycleEventArgs $args) : void
                {
                    EventScheduler::instance()->trigger(Event::DATA_CHANGED, ['created', $args->getEntityManager(), $args->getEntity()]);
                }

                public function postUpdate(LifecycleEventArgs $args) : void
                {
                    EventScheduler::instance()->trigger(Event::DATA_CHANGED, ['updated', $args->getEntityManager(), $args->getEntity()]);
                }

                public function postRemove(LifecycleEventArgs $args) : void
                {
                    EventScheduler::instance()->trigger(Event::DATA_CHANGED, ['deleted', $args->getEntityManager(), $args->getEntity()]);
                }
            });
        }
    }
26567
public function beforeCompile(): void
	{
		// Skip if it's not CLI mode
		if (!$this->cliMode) {
			return;
		}

		$builder = $this->getContainerBuilder();

		// Lookup for Symfony Console Application
		$application = $builder->getDefinitionByType(Application::class);

		// Register helpers
		$entityManagerHelper = $this->prefix('@entityManagerHelper');
		$application->addSetup(new Statement('$service->getHelperSet()->set(?,?)', [$entityManagerHelper, 'em']));
	}
1110862
def on_batch_begin(self, last_input, last_target, **kwargs):
        ""
        self.acc_samples += last_input.shape[0]
        self.acc_batches += 1
1063637
function (internalInstance, transaction, updateBatchNumber) {
    if (internalInstance._updateBatchNumber !== updateBatchNumber) {
      // The component's enqueued batch number should always be the current
      // batch or the following one.
      process.env.NODE_ENV !== 'production' ? warning(internalInstance._updateBatchNumber == null || internalInstance._updateBatchNumber === updateBatchNumber + 1, 'performUpdateIfNecessary: Unexpected batch number (current %s, ' + 'pending %s)', updateBatchNumber, internalInstance._updateBatchNumber) : void 0;
      return;
    }
    if (process.env.NODE_ENV !== 'production') {
      if (internalInstance._debugID !== 0) {
        ReactInstrumentation.debugTool.onBeforeUpdateComponent(internalInstance._debugID, internalInstance._currentElement);
      }
    }
    internalInstance.performUpdateIfNecessary(transaction);
    if (process.env.NODE_ENV !== 'production') {
      if (internalInstance._debugID !== 0) {
        ReactInstrumentation.debugTool.onUpdateComponent(internalInstance._debugID);
      }
    }
  }
1222502
@Override
    public synchronized void addBatch(final String name, final EntityEntry entry) throws DatabaseEngineException {

        try {

            final MappedEntity me = entities.get(name);

            if (me == null) {
                throw new DatabaseEngineException(String.format("Unknown entity '%s'", name));
            }

            PreparedStatement ps = me.getInsert();
            entityToPreparedStatement(me.getEntity(), ps, entry, true);

            ps.addBatch();
        } catch (final Exception ex) {
            throw new DatabaseEngineException("Error adding to batch", ex);
        }

    }
1007089
def before_processing(eng, objects):
        """"""
        super(InvenioProcessingFactory, InvenioProcessingFactory)\
            .before_processing(eng, objects)
        eng.save(WorkflowStatus.RUNNING)
        db.session.commit()
670068
private void scheduleBatchLoadIfNeeded(Serializable id, SharedSessionContractImplementor session) throws MappingException {
		//cannot batch fetch by unique key (property-ref associations)
		if ( StringHelper.isEmpty( delegate.getRHSUniqueKeyPropertyName() ) && id != null ) {
			EntityPersister persister = session.getFactory().getMetamodel().entityPersister( delegate.getAssociatedEntityName() );
			EntityKey entityKey = session.generateEntityKey( id, persister );
			if ( !session.getPersistenceContext().containsEntity( entityKey ) ) {
				session.getPersistenceContext().getBatchFetchQueue().addBatchLoadableEntityKey( entityKey );
			}
		}
	}
64950
def insert_before_each(middleware, *args, &block)
      self.stack = stack.reduce([]) do |carry, item|
        carry.push([middleware, args, block], item)
      end
    end
1164824
def _prepare_batch(batch, device=None, non_blocking=False):
    
    x, y = batch
    return (convert_tensor(x, device=device, non_blocking=non_blocking),
            convert_tensor(y, device=device, non_blocking=non_blocking))
439897
function batchedUpdates(fn, a) {
    var previousIsBatchingUpdates = isBatchingUpdates;
    isBatchingUpdates = true;
    try {
      return fn(a);
    } finally {
      isBatchingUpdates = previousIsBatchingUpdates;
      if (!isBatchingUpdates && !isRendering) {
        performSyncWork();
      }
    }
  }
1298565
public function on_before_render()
    {
        $pageTitle = $this->get('pageTitle');
        if (!$pageTitle) {
            $this->set('pageTitle', t($this->c->getCollectionName()));
        }
        $dbConfig = $this->app->make('config/database');
        $this->set('showPrivacyPolicyNotice', !$dbConfig->get('app.privacy_policy_accepted'));
        $this->set('token', $this->token);
        $this->set('error', $this->error);
    }
749619
function renderPdf( runtime , data ) {
	prepareRenderPdf( runtime , data ) ;
	runtime.pendingPdfCommands.push( data ) ;
}
979550
public function beforeRender()
    {
        $this->config->show_as_content_block = false;
        $this->config->title = Piwik::translate('Live_VisitorLog');
        $this->config->disable_row_actions = true;
        $this->config->datatable_js_type = 'VisitorLog';
        $this->config->enable_sort       = false;
        $this->config->show_search       = false;
        $this->config->show_exclude_low_population = false;
        $this->config->show_offset_information     = false;
        $this->config->show_all_views_icons        = false;
        $this->config->show_table_all_columns      = false;
        $this->config->show_export_as_rss_feed     = false;
        $this->config->disable_all_rows_filter_limit = true;

        $this->config->documentation = Piwik::translate('Live_VisitorLogDocumentation', array('<br />', '<br />'));

        if (!is_array($this->config->custom_parameters)) {
            $this->config->custom_parameters = array();
        }

        // ensure to show next link if there are enough rows for a next page
        if ($this->dataTable->getRowsCount() > $this->requestConfig->filter_limit) {
            $this->dataTable->deleteRowsOffset($this->requestConfig->filter_limit);
            $this->config->custom_parameters['totalRows'] = 10000000;
        }

        $this->config->custom_parameters['smallWidth'] = (1 == Common::getRequestVar('small', 0, 'int'));
        $this->config->custom_parameters['hideProfileLink'] = (1 == Common::getRequestVar('hideProfileLink', 0, 'int'));
        $this->config->custom_parameters['pageUrlNotDefined'] = Piwik::translate('General_NotDefined', Piwik::translate('Actions_ColumnPageURL'));

        $this->config->footer_icons = array(
            array(
                'class'   => 'tableAllColumnsSwitch',
                'buttons' => array(
                    array(
                        'id'    => static::ID,
                        'title' => Piwik::translate('Live_LinkVisitorLog'),
                        'icon'  => 'plugins/Morpheus/images/table.png'
                    )
                )
            )
        );

        $enableAddNewSegment = Common::getRequestVar('enableAddNewSegment', false);
        if ($enableAddNewSegment) {
            $this->config->datatable_actions[] = [
                'id' => 'addSegmentToMatomo',
                'title' => Piwik::translate('SegmentEditor_AddThisToMatomo'),
                'icon' => 'icon-segment',
            ];
        }
    }