@param Batch $batch

@return \Generator|Instruction[]
339116
public function process(Batch $batch)
    {
        $flags = $batch->getFlags();

        foreach ($this->inputs($batch->getInputs()) as $input) {
            foreach ($this->templates($batch->getTemplates()) as $template) {
                $instruction = $this->instructionCreator->createInstruction($input, $template, $flags);

                if (!$instruction) {
                    continue;
                }

                yield $instruction;
            }
        }
    }
648922
public function fetchBatchTags($batchId)
    {
        $result = $this->_get($this->_batchUrl($batchId, '/tags'));
        return Deserialize::tags($result);
    }
810174
def batch_iterable(l, n):
    ''' '''
    i = iter(l)
    piece = list(islice(i, n))
    while piece:
        yield piece
        piece = list(islice(i, n))
1061334
private int[] convertBatch(int[] batch) {
        int[] conv = new int[batch.length];
        for (int i=0; i<batch.length; i++) {
            conv[i] = sample[batch[i]];
        }
        return conv;
    }
135822
private List<Entity> findAllBatch(List<Object> batch) {
    String entityId = getEntityType().getId();
    EntityType entityType = getEntityType();
    List<Object> missingIds =
        batch
            .stream()
            .filter(id -> !l1Cache.get(entityId, id, entityType).isPresent())
            .collect(toList());

    Map<Object, Entity> missingEntities =
        delegate().findAll(missingIds.stream()).collect(toMap(Entity::getIdValue, e -> e));

    return batch
        .stream()
        .map(
            id ->
                l1Cache
                    .get(entityId, id, getEntityType())
                    .map(CacheHit::getValue)
                    .orElse(missingEntities.get(id)))
        .collect(toList());
  }
1288408
private function manageBatch(array $batch, $max = 0)
    {
        if (count($batch) >= $max) {
            $this->entityManager->flush();
            $batch = [];
        }

        return $batch;
    }
751640
private static function _batchUpdateHelper(Api\MtBatchSmsUpdate $batch)
    {
        $fields = [];

        if (!empty($batch->getRecipientInsertions())) {
            $fields['to_add'] = $batch->getRecipientInsertions();
        }

        if (!empty($batch->getRecipientRemovals())) {
            $fields['to_remove'] = $batch->getRecipientRemovals();
        }

        if (null != $batch->getSender()) {
            $fields['from'] = $batch->getSender();
        }

        if (null != $batch->getDeliveryReport()) {
            if ($batch->getDeliveryReport() === Api\Reset::reset()) {
                $fields['delivery_report'] = null;
            } else {
                $fields['delivery_report'] = $batch->getDeliveryReport();
            }
        }

        if (null != $batch->getSendAt()) {
            if ($batch->getSendAt() === Api\Reset::reset()) {
                $fields['send_at'] = null;
            } else {
                $fields['send_at'] = Serialize::_dateTime($batch->getSendAt());
            }
        }

        if (null != $batch->getExpireAt()) {
            if ($batch->getExpireAt() === Api\Reset::reset()) {
                $fields['expire_at'] = null;
            } else {
                $fields['expire_at']
                    = Serialize::_dateTime($batch->getExpireAt());
            }
        }

        if (null != $batch->getCallbackUrl()) {
            if ($batch->getCallbackUrl() === Api\Reset::reset()) {
                $fields['callback_url'] = null;
            } else {
                $fields['callback_url'] = $batch->getCallbackUrl();
            }
        }

        return $fields;
    }
614613
private function resolveTypes($type)
    {
        $batchTypes = [];

        do {
            $batchTypes[] = $batchType = $this->batchRegistry[$type];
        } while (($type = $batchType->getParent()) !== null);

        return $batchTypes;
    }
850289
def batch(batch_size, items):
    ""
    items = list(items)
    if batch_size is None:
        return [items]
    MISSING = object()
    padded_items = items + [MISSING] * (batch_size - 1)
    groups = zip(*[padded_items[i::batch_size] for i in range(batch_size)])
    return [[item for item in group if item != MISSING] for group in groups]
83665
public function assignEntryPointFromBatch(array $batch)
    {
        $entryPoint = collect($batch)->first(function ($entry) {
            return in_array($entry->type, [EntryType::REQUEST, EntryType::JOB, EntryType::COMMAND]);
        });

        if (! $entryPoint) {
            return;
        }

        $this->content = array_merge($this->content, [
            'entry_point_type' => $entryPoint->type,
            'entry_point_uuid' => $entryPoint->uuid,
            'entry_point_description' => $this->entryPointDescription($entryPoint),
        ]);
    }
545097
public function batch(int $n = 50) : array
    {
        $sChunks = array_chunk($this->samples, $n);
        $lChunks = array_chunk($this->labels, $n);

        $batches = [];

        foreach ($sChunks as $i => $samples) {
            $batches[] = self::quick($samples, $lChunks[$i]);
        }

        return $batches;
    }
1372451
public function dispatchBatchesIfNeeded() {
        foreach(static::$batchClasses as $batch => $batchClass) {
            if ($this->status($batch)) {
                $lastRun = $this->lastRun($batch);

                if ((time() - $lastRun) > 60) {
                    $this->setLastRun($batch, time());

                    /** @var BackgroundProcess $process */
                    $process = new $batchClass();
                    $process->dispatch();
                }
            }
        }
    }
441545
public function getItems($batch = false) {
		$entities = new ElggBatch($this->getter, $this->getOptions());
		if ($batch) {
			return $entities;
		}
		$items = [];
		foreach ($entities as $entity) {
			$items[] = $entity;
		}
		return $items;
	}
815565
public function set($data, $batch = false) {
        $this->data  = $data;
        $this->batch = $batch;

        return $this;
    }
263960
def learn_batch(self, inputBatch):
        """"""
        X = inputBatch
        Y = self.encode_batch(X)
        self.update_statistics(Y) 
        self.update_weights(X,Y)
        return Y
680851
public function pluckBatchIds(): array
    {
        $ids = [];

        /** @var Store $store */
        foreach ($this->paginator() as $store) {
            $ids[] = $store->get($this->batchIdName);
        }

        return $ids;
    }
175323
@Override
	@Deprecated
	public int[] batch() {
		if (context().batchCount() == 0) {
			return new int[0];
		}
		if (!batch) {
			addBatch();
		}
		try {
			return agent().batch(context());
		} catch (Exception e) {
			throw new UroborosqlSQLException(e);
		}
	}