Add this operation to the _Bulk instance `bulkobj`.
1673
def _add_to_bulk(self, bulkobj):
        """"""
        bulkobj.add_update(self._filter, self._doc, False, self._upsert,
                           collation=self._collation)
994015
def add(cls, task_cls):
		

		if task_cls.__registry_tag__ is None and cls.__skip_none_registry_tag__ is True:
			return

		cls.registry_storage().add(task_cls)
1222471
def populate_resobj(rexobj, mobj, loc):
    '''
    
    '''
    resobj = REXResult(mobj, loc)
    rexobj.matches.append(resobj)
    rexobj.res_count += 1
1139692
def bulk_history_create(self, objs, batch_size=None):
        """"""

        historical_instances = [
            self.model(
                history_date=getattr(instance, "_history_date", now()),
                history_user=getattr(instance, "_history_user", None),
                history_change_reason=getattr(instance, "changeReason", ""),
                history_type="+",
                **{
                    field.attname: getattr(instance, field.attname)
                    for field in instance._meta.fields
                    if field.name not in self.model._history_excluded_fields
                }
            )
            for instance in objs
        ]

        return self.model.objects.bulk_create(
            historical_instances, batch_size=batch_size
        )
20266
def bulk_create(self, *args, **kwargs):
        
        ret_val = super(ManagerUtilsQuerySet, self).bulk_create(*args, **kwargs)
        post_bulk_operation.send(sender=self.model, model=self.model)
        return ret_val
284980
def add_instance(self, inst, index=None):
        
        if index is None:
            self.__append_instance(inst.jobject)
        else:
            self.__insert_instance(index, inst.jobject)
1242536
function extend ( fromObj, toObj ) {
        for ( var key in toObj ) {
            fromObj[key] = toObj[key];
        }
    
        return fromObj;
    }
1169685
synchronized void bulkRegisterSingleton() {
        for (Map.Entry<Class<? extends AppService>, AppService> entry : registry.entrySet()) {
            if (isSingletonService(entry.getKey())) {
                app.registerSingleton(entry.getKey(), entry.getValue());
            }
        }
    }
1080223
function addToOperationsList(bulkOperation, docType, document) {
  // Get the bsonSize
  const bsonSize = bson.calculateObjectSize(document, {
    checkKeys: false
  });

  // Throw error if the doc is bigger than the max BSON size
  if (bsonSize >= bulkOperation.s.maxBatchSizeBytes)
    throw toError('document is larger than the maximum size ' + bulkOperation.s.maxBatchSizeBytes);

  // Create a new batch object if we don't have a current one
  if (bulkOperation.s.currentBatch == null)
    bulkOperation.s.currentBatch = new Batch(docType, bulkOperation.s.currentIndex);

  // Check if we need to create a new batch
  if (
    bulkOperation.s.currentBatchSize + 1 >= bulkOperation.s.maxWriteBatchSize ||
    bulkOperation.s.currentBatchSizeBytes + bulkOperation.s.currentBatchSizeBytes >=
      bulkOperation.s.maxBatchSizeBytes ||
    bulkOperation.s.currentBatch.batchType !== docType
  ) {
    // Save the batch to the execution stack
    bulkOperation.s.batches.push(bulkOperation.s.currentBatch);

    // Create a new batch
    bulkOperation.s.currentBatch = new Batch(docType, bulkOperation.s.currentIndex);

    // Reset the current size trackers
    bulkOperation.s.currentBatchSize = 0;
    bulkOperation.s.currentBatchSizeBytes = 0;
  } else {
    // Update current batch size
    bulkOperation.s.currentBatchSize = bulkOperation.s.currentBatchSize + 1;
    bulkOperation.s.currentBatchSizeBytes = bulkOperation.s.currentBatchSizeBytes + bsonSize;
  }

  if (docType === common.INSERT) {
    bulkOperation.s.bulkResult.insertedIds.push({
      index: bulkOperation.s.currentIndex,
      _id: document._id
    });
  }

  // We have an array of documents
  if (Array.isArray(document)) {
    throw toError('operation passed in cannot be an Array');
  } else {
    bulkOperation.s.currentBatch.originalIndexes.push(bulkOperation.s.currentIndex);
    bulkOperation.s.currentBatch.operations.push(document);
    bulkOperation.s.currentBatchSizeBytes = bulkOperation.s.currentBatchSizeBytes + bsonSize;
    bulkOperation.s.currentIndex = bulkOperation.s.currentIndex + 1;
  }

  // Return bulkOperation
  return bulkOperation;
}
1171367
function bulksDoc (docs, qs0, callback0) {
      const { opts, callback } = getCallback(qs0, callback0)
      return relax({
        db: dbName,
        path: '_bulk_docs',
        body: docs,
        method: 'POST',
        qs: opts
      }, callback)
    }
794604
def add(self, obj):
        
        activity = {
            "verb": "add",
            "object": {
                "objectType": obj.object_type,
                "id": obj.id
            },
            "target": {
                "objectType": self.object_type,
                "id": self.id
            }
        }

        self._post_activity(activity)

        # Remove the cash so it's re-generated next time it's needed
        self._members = None
1027619
def bulk_update_from_activity(activity)
      all_aggs = entities_as_json_hashes(activity)
      agg_batches = bulk_update_batches(all_aggs)
      agg_batches.each do |batch|
        index_with_error_handling(activity) { bulk_add(batch) }
      end
    end
591542
def dump_bulk(cls, parent=None, keep_ids=True):
        """"""

        cls = get_result_class(cls)

        # Because of fix_tree, this method assumes that the depth
        # and numchild properties in the nodes can be incorrect,
        # so no helper methods are used
        qset = cls._get_serializable_model().objects.all()
        if parent:
            qset = qset.filter(path__startswith=parent.path)
        ret, lnk = [], {}
        for pyobj in serializers.serialize('python', qset):
            # django's serializer stores the attributes in 'fields'
            fields = pyobj['fields']
            path = fields['path']
            depth = int(len(path) / cls.steplen)
            # this will be useless in load_bulk
            del fields['depth']
            del fields['path']
            del fields['numchild']
            if 'id' in fields:
                # this happens immediately after a load_bulk
                del fields['id']

            newobj = {'data': fields}
            if keep_ids:
                newobj['id'] = pyobj['pk']

            if (not parent and depth == 1) or\
               (parent and len(path) == len(parent.path)):
                ret.append(newobj)
            else:
                parentpath = cls._get_basepath(path, depth - 1)
                parentobj = lnk[parentpath]
                if 'children' not in parentobj:
                    parentobj['children'] = []
                parentobj['children'].append(newobj)
            lnk[path] = newobj
        return ret
306194
def add(self, iocb):
        """"""
        if _debug: IOGroup._debug("add %r", iocb)

        # add this to our members
        self.ioMembers.append(iocb)

        # assume all of our members have not completed yet
        self.ioState = PENDING
        self.ioComplete.clear()

        # when this completes, call back to the group.  If this
        # has already completed, it will trigger
        iocb.add_callback(self.group_callback)
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;
    }
37565
public BulkOperation createBulkOperation(final Collection<?> objects, final boolean allOrNothing) {
		try {
			final PipedOutputStream out = new PipedOutputStream();
			PipedInputStream in = new PipedInputStream(out);

			Future<?> writeTask = executorService.submit(new Runnable() {

				public void run() {
					try {
						bulkDocWriter.write(objects, allOrNothing, out);
					} catch (Exception e) {
						LOG.error("Caught exception while writing bulk document:", e);
					}

				}
			});

			return new BulkOperation(writeTask, in);
		} catch (IOException e) {
			throw Exceptions.propagate(e);
		}
	}
862556
def _add_action(self, action):
        
        kwargs = self._get_method_params()

        kwargs['action'] = action

        self._bulk_actions.append(kwargs)