Add a data to internal deque data structure
768767
public final Future<RecordMetadata> enqueue (D record, WriteCallback callback) throws InterruptedException {
    final ReentrantLock lock = this.dqLock;
    lock.lock();
    try {
      BytesBoundedBatch last = dq.peekLast();
      if (last != null) {
        Future<RecordMetadata> future = null;
        try {
          future = last.tryAppend(record, callback, this.largeMessagePolicy);
        } catch (RecordTooLargeException e) {
          // Ok if the record was too large for the current batch
        }
        if (future != null) {
          return future;
        }
      }

      // Create a new batch because previous one has no space
      BytesBoundedBatch batch = new BytesBoundedBatch(this.memSizeLimit, this.expireInMilliSecond);
      LOG.debug("Batch " + batch.getId() + " is generated");
      Future<RecordMetadata> future = null;
      try {
        future = batch.tryAppend(record, callback, this.largeMessagePolicy);
      } catch (RecordTooLargeException e) {
        // If a new batch also wasn't able to accomodate the new message
        throw new RuntimeException("Failed due to a message that was too large", e);
      }

      // The future might be null, since the largeMessagePolicy might be set to DROP
      if (future == null) {
        assert largeMessagePolicy.equals(LargeMessagePolicy.DROP);
        LOG.error("Batch " + batch.getId() + " is silently marked as complete, dropping a huge record: "
                + record);
        future = Futures.immediateFuture(new RecordMetadata(0));
        callback.onSuccess(WriteResponse.EMPTY);
        return future;
      }

      // if queue is full, we should not add more
      while (dq.size() >= this.capacity) {
        LOG.debug("Accumulator size {} is greater than capacity {}, waiting", dq.size(), this.capacity);
        this.notFull.await();
      }
      dq.addLast(batch);
      incomplete.add(batch);
      this.notEmpty.signal();
      return future;

    } finally {
      lock.unlock();
    }
  }
256701
def parse_data_to_internal(self, include_custom=False):
        
        for element in self.data:
            self.data[element].parse_data_to_internal()
        if include_custom:
            for element in self.custom_data:
                self.custom_data[element].parse_data_to_internal()
1171085
private void fillDataStructures() {
        final ITreeData treeData = mRtx.getNode();
        mInOrder.put(treeData, true);
        mDescendants.put(treeData, 1L);
    }
1065870
public Object add(Object data, int iOpenMode) throws DBException, RemoteException
    {
        Object key = this.getKey(data);
        if (key == null)
        {   // If autosequence, bump key
            try   {
                key = m_mDataMap.lastKey();
            } catch (NoSuchElementException ex)   {
                key = new Integer(0);
            }
            if (key instanceof Integer)   // Always
                key = new Integer(((Integer)key).intValue() + 1);
            ((Vector)data).set(0, key);
        }
        if (m_mDataMap.get(key) != null)
            throw new DBException("Duplicate record");
        m_mDataMap.put(key, data);
        m_objCurrentKey = null;
        m_iterator = null;
        
        return key;
    }
269931
def prj_add_dep(self, *args, **kwargs):
        
        if not self.cur_prj:
            return
        dialog = DepAdderDialog(project=self.cur_prj)
        dialog.exec_()
        deps = dialog.deps
        for dep in deps:
            depdata = djitemdata.DepartmentItemData(dep)
            treemodel.TreeItem(depdata, self.prj_dep_model.root)
885723
def add_data(self, request, pk=None):
        """"""
        collection = self.get_object()

        if 'ids' not in request.data:
            return Response({"error": "`ids`parameter is required"}, status=status.HTTP_400_BAD_REQUEST)

        missing = []
        for data_id in request.data['ids']:
            if not Data.objects.filter(pk=data_id).exists():
                missing.append(data_id)

        if missing:
            return Response(
                {"error": "Data objects with following ids are missing: {}".format(', '.join(missing))},
                status=status.HTTP_400_BAD_REQUEST)

        for data_id in request.data['ids']:
            collection.data.add(data_id)

        return Response()
451546
def insert(self, i, v):
        """"""
        self.list1.insert(i, v)
        self.list2.insert(i, v.obj)
        if isinstance(v, EpBunch):
            v.theidf = self.theidf
1324732
void addInterfaces(Deque<String> intfs, ClassFile cf)
            throws ConstantPoolException {
        int count = cf.interfaces.length;
        for (int i = 0; i < count; i++) {
            intfs.addLast(cf.getInterfaceName(i));
        }
    }
1139055
def insertData(self, offset: int, string: str) -> None:
        """"""
        self._insert_data(offset, string)
24577
def set_model_internal_data(model, original_data, modified_data, deleted_data):
    
    model.__original_data__ = original_data
    list(map(model._prepare_child, model.__original_data__))

    model.__modified_data__ = modified_data
    list(map(model._prepare_child, model.__modified_data__))

    model.__deleted_fields__ = deleted_data

    return model
310256
def _add_to_obj(self, rec_curr, typedef_curr, line):
        """"""
        if rec_curr is not None:
            self._add_to_ref(rec_curr, line)
        else:
            add_to_typedef(typedef_curr, line)
885000
public void addDatabaseProperty(String strKey, String strValue)
    {
        this.setProperty(strKey, strValue);
        Environment env = (Environment)this.getDatabaseOwner().getEnvironment();
        if (env.getCachedDatabaseProperties(this.getDatabaseName(true)) != null)  // Always
            if (env.getCachedDatabaseProperties(this.getDatabaseName(true)) != Environment.DATABASE_DOESNT_EXIST)  // Always
                env.getCachedDatabaseProperties(this.getDatabaseName(true)).put(strKey, strValue);
    }
320413
def _convert_to_internal(self, data):
        """'"""
        for _dict in data:
            keys = list(_dict.keys())[:]
            for key in keys:
                if key not in self._disp_cols:
                    raise Exception(key + ' not a column in current List.')
                _dict[self._disp_cols[key]['name']] = self._sp_type(key, _dict.pop(key))
1211507
private void addNthChild(final boolean byType) {
		for (Node node : nodes) {
			Index index = helper.getIndexInParent(node, byType);

			if (specifier.isMatch(index.index+1))
				result.add(node);
		}
	}
1002178
def save_data(self, idx):
        """"""
        for subseqs in self:
            if isinstance(subseqs, abctools.OutputSequencesABC):
                subseqs.save_data(idx)
1294644
def append(self, item):
        
        self._deque.append(item)
        self.notEmpty.set()
466700
function (src, destId, next, parent) {
            var oldId = src.id;
            src.parent = destId;

            async.waterfall([
                async.apply(_getAncestorsFromImmediateParent, destId, parent),
                function saveNodesAncestors(newAncestors, next) {
                    src.ancestors = newAncestors;
                    src._id = new ObjectId();
                    pendingInsertNodes.push(src);
                    async.parallel([
                            function findContentEntries(next) {
                                contentModel.find({"meta.node": oldId}).exec(function (err, data) {
                                    if (err) {
                                        next(err);
                                    }
                                    else {
                                        next(null, data);
                                    }
                                });
                            },
                            function findNodeEntries(next) {
                                nodeModel.find({parent: oldId}).exec(function (err, data) {
                                    if (err) {
                                        next(err);
                                    }
                                    else {
                                        next(null, data);
                                    }
                                });
                            }
                        ],
                        function handleFoundContentAndNodes(err, data) {
                            var contentEntries = data[0], nodeEntries = data[1];
                            _.each(contentEntries, function (item) {
                                item.meta.node = src._id;
                                item._id = new ObjectId();
                                pendingInsertContent.push(item);
                            });
                            if (!nodeEntries.length) {
                                next();
                            }
                            else {
                                async.each(nodeEntries, function (item, next) {
                                    _recursiveCopyNodes(item, src._id, next, src);
                                }, function (err) {
                                    next(err);
                                });
                            }
                        });

                }
            ], function (err) {
                next(err);
            });
        }