Bulk ---------------
969236
protected function applyBulk( $model, $column, $action, $target, $config = [] ) {

		switch( $column ) {

			case 'model': {

				switch( $action ) {

					case 'active': {

						$model->active = true;

						$model->update();

						break;
					}
					case 'inactive': {

						$model->active = false;

						$model->update();

						break;
					}
					case 'delete': {

						$this->delete( $model );

						break;
					}
				}

				break;
			}
		}
	}
389740
public function flush()
    {
        $bulkRequest = array_filter($this->currentBulkRequest);
        if (count($bulkRequest) === 0) {
            return;
        }

        $content = '';
        foreach ($bulkRequest as $bulkRequestTuple) {
            $tupleAsJson = '';
            foreach ($bulkRequestTuple as $bulkRequestItem) {
                $itemAsJson = json_encode($bulkRequestItem);
                if ($itemAsJson === false) {
                    $this->errorHandlingService->log(
                        new MalformedBulkRequestError('Indexing Error: Bulk request item could not be encoded as JSON - ' . json_last_error_msg(), $bulkRequestItem)
                    );
                    continue 2;
                }
                $tupleAsJson .= $itemAsJson . chr(10);
            }
            $content .= $tupleAsJson;
        }

        if ($content !== '') {
            $response = $this->requestDriver->bulk($this->getIndex(), $content);
            foreach ($response as $responseLine) {
                if (isset($response['errors']) && $response['errors'] !== false) {
                    $this->errorHandlingService->log(
                        new BulkIndexingError($this->currentBulkRequest, $responseLine)
                    );
                }
            }
        }

        $this->currentBulkRequest = [];
    }
569316
public Iterable<T> bulkInstantiate(final Iterable<S> input) throws FrameworkException {
		return Iterables.map(this, input);
	}
1216399
public function bulkUpdate($values)
    {
        foreach ($values as $property => $value) {
            $this->update($property, $value);
        }
        
        return $this;
    }
1166716
protected function bulk(Request $request, $action, $transKey, array $input = [])
    {
        $this->validate($request, ['items' => 'required']);

        $items = $request->input('items');
        $request->replace($input);
        $models = collect();

        foreach ($items as $id) {
            $response = $this->{$action}($id, $request);

            if (!$response->isNotFound()) {
                if ($response->isClientError()) {
                    return $response;
                }

                $models->push($response->getOriginalContent());
            }
        }

        return $this->response($models, $this->trans($transKey, $models->count()));
    }
1025118
def bulk_copy(self, ids):
        
        schema = ResultSchema()
        return self.service.bulk_copy(self.base, self.RESOURCE, ids, schema)
1080983
protected void bulkInsertWithComparator() {
        if (insertionBufferSize == 0) {
            return;
        }
        int right = size + insertionBufferSize - 2;
        int left = Math.max(size, right / 2);
        while (insertionBufferSize > 0) {
            --insertionBufferSize;
            array[size] = insertionBuffer[insertionBufferSize];
            insertionBuffer[insertionBufferSize] = null;
            reverse.clear(size);
            ++size;
        }
        while (right > left + 1) {
            left = left / 2;
            right = right / 2;
            for (int j = left; j <= right; j++) {
                fixdownWithComparator(j);
            }
        }
        if (left != 0) {
            int i = dancestor(left);
            fixdownWithComparator(i);
            fixupWithComparator(i);
        }
        if (right != 0) {
            int i = dancestor(right);
            fixdownWithComparator(i);
            fixupWithComparator(i);
        }
        insertionBufferMinPos = 0;
    }
34767
public function bulkButtons()
    {
        $buttons = [];
        if (\Yii::$app->user->checkAccess('update::' . $this->getCompatibilityId())) {
            $buttons[] = [
                'text' => 'Activate',
                'url' => Url::toRoute('activate-all'),
                'options' => [
                    'class' => 'pull-left btn btn-xs btn-success all-activate',
                    'data-pjax' => '0',
                    'onclick' => 'javascript: if(confirm("Are you sure you want to activate the selected items?")) myGrid.submit($(this)); return false;'
                ]
            ];
            $buttons[] = [
                'text' => 'Deactivate',
                'url' => Url::toRoute('deactivate-all'),
                'options' => [
                    'class' => 'pull-left btn btn-xs btn-primary all-deactivate',
                    'data-pjax' => '0',
                    'onclick' => 'javascript: if(confirm("Are you sure you want to deactivate the selected items?")) myGrid.submit($(this)); return false;'
                ]
            ];
        }
        if (\Yii::$app->user->checkAccess('delete::' . $this->getCompatibilityId())) {
            $buttons[] = [
                'text' => 'Delete',
                'url' => Url::toRoute('delete-all'),
                'options' => [
                    'class' => 'pull-left btn btn-xs btn-danger all-delete',
                    'data-pjax' => '0',
                    'onclick' => 'javascript: if(confirm("Are you sure you want to delete the selected items?")) myGrid.submit($(this)); return false;'
                ]
            ];
        }
        return $buttons;
    }
906006
public function bulk() {
        $this->action = self::API_ACTION_BULK;
        $saved = FALSE;
        $status = 400;
        $message = null;
        try {
            $this->hydrateBulkRequest();
            $this->saveBulk();
            $saved = true;
            $status = 200;
        } catch(\Exception $e) {
            Logger::log($e->getMessage(), LOG_CRIT, $this->getRequest()->getData());
            $message = t('Bulk insert rolled back');
        }
        return $this->json(new JsonResponse($this->exportList(), $saved, count($this->list), 1, $message), $status);
    }
1349035
def bulk_get(cls, files, api=None):
        
        api = api or cls._API
        file_ids = [Transform.to_file(file_) for file_ in files]
        data = {'file_ids': file_ids}

        logger.info('Getting files in bulk.')
        response = api.post(url=cls._URL['bulk_get'], data=data)
        return FileBulkRecord.parse_records(response=response, api=api)
845939
protected function hydrateBulkRequest() {
        $class = new \ReflectionClass($this->getModelNamespace());
        $this->list = [];
        foreach($this->data as $item) {
            if(is_array($item)) {
                if(count($this->list) < Config::getParam('api.block.limit', 1000)) {
                    /** @var ActiveRecordInterface $model */
                    $model = $class->newInstance();
                    $this->hydrateModelFromRequest($model, $item);
                    $this->list[] = $model;
                } else {
                    Logger::log(t('Max items per bulk insert raised'), LOG_WARNING, count($this->data) . t('items'));
                }
            }
        }
    }
1673
def _add_to_bulk(self, bulkobj):
        """"""
        bulkobj.add_update(self._filter, self._doc, False, self._upsert,
                           collation=self._collation)
766369
def get_bulk(non_repeaters, max_repetitions, object_list)
      varbind_list = @mib.varbind_list(object_list, :NullValue)
      request = GetBulkRequest.new(
          @@request_id.next,
          varbind_list,
          non_repeaters,
          max_repetitions)
      try_request(request)
    end
527178
def bulk_query(self, query, *multiparams):
        """"""

        self._conn.execute(text(query), *multiparams)
288226
public function saveData()
    {
        $rows = $this->getData();
        if (empty($rows)) {
            return;
        }

        $bulk = true;
        $row = current($rows);
        $c = array_keys($row);
        foreach ($this->getData() as $row) {
            $k = array_keys($row);
            if ($k != $c) {
                $bulk = false;
                break;
            }
        }

        if ($bulk) {
            $this->getAdapter()->bulkinsert($this, $this->getData());
        } else {
            foreach ($this->getData() as $row) {
                $this->getAdapter()->insert($this, $row);
            }
        }
    }
227242
def process(self, tup):
        
        self.es.bulk(
            self.generate_bulk_body(tup.values[2]),
            index=self.index,
            doc_type=self.doc_type)
946797
def query_bulk(names):
    """"""
    answers = [__threaded_query(name) for name in names]

    while True:
        if all([a.done() for a in answers]):
            break
        sleep(1)

    return [answer.result() for answer in answers]