Adds batch with give ID and list of properties.
551333
def add_batch(self, batch_id, batch_properties=None):
    """"""
    if batch_properties is None:
      batch_properties = {}
    if not isinstance(batch_properties, dict):
      raise ValueError('batch_properties has to be dict, however it was: '
                       + str(type(batch_properties)))
    self._data[batch_id] = batch_properties.copy()
    self._data[batch_id]['images'] = {}
1113067
def AddBatchJob(client):
  
  # Initialize appropriate service.
  batch_job_service = client.GetService('BatchJobService', version='v201809')
  # Create a BatchJob.
  batch_job_operations = [{
      'operand': {},
      'operator': 'ADD'
  }]
  return batch_job_service.mutate(batch_job_operations)['value'][0]
487229
def add(self, directory, path=None) -> None:
        """"""
        objecttools.valid_variable_identifier(directory)
        if path is None:
            path = directory
        setattr(self, directory, path)
1082520
void put(final AbstractBatchEntry batchEntry) {
    try {
        this.queue.put(batchEntry);
    } catch (InterruptedException e) {
        throw new RuntimeException(e);
    }
    if (this.queue.size() >= this.actions) {
      this.scheduler.submit(new Runnable() {
        @Override
        public void run() {
          write();
        }
      });
    }
  }
1270029
private BatchObject initBatchObject(Identity identity, Class clazz) {
        if (EventData.class.equals(clazz)) {
            RowBatch rowbatch = new RowBatch();
            rowbatch.setIdentity(identity);
            return rowbatch;
        } else if (FileData.class.equals(clazz)) {
            FileBatch fileBatch = new FileBatch();
            fileBatch.setIdentity(identity);
            return fileBatch;
        } else {
            throw new TransformException("no support Data[" + clazz.getName() + "]");
        }
    }
769299
def _add_to_batch_list(self, TX, payment):
        
        batch_key = payment.get('execution_date', None)
        if batch_key in self._batches.keys():
            self._batches[batch_key].append(TX['CdtTrfTxInfNode'])
        else:
            self._batches[batch_key] = []
            self._batches[batch_key].append(TX['CdtTrfTxInfNode'])

        if batch_key in self._batch_totals:
            self._batch_totals[batch_key] += payment['amount']
        else:
            self._batch_totals[batch_key] = payment['amount']
1193471
def _expand_batch(cls, batch):
        
        cls._parse_header(BatchHeader, batch)
        if 'transactions' in batch:
            batch['transactions'] = [
                cls._expand_transaction(t) for t in batch['transactions']]
        return batch
1051354
def add_to_inventory(self):
        """"""
        host = self.db_attrs.pop(A.database.HOST)
        self.stack.add_host(
                host,
                self.groups,
                self.db_attrs
                )
810656
private void setUpdateProperties(final String id, final JSONObject needUpdateJsonObject,
                                     final List<Object> paramList, final StringBuilder sql) throws JSONException {
        final Iterator<String> keys = needUpdateJsonObject.keys();
        String key;

        boolean isFirst = true;
        final StringBuilder wildcardString = new StringBuilder();

        while (keys.hasNext()) {
            key = keys.next();

            if (isFirst) {
                wildcardString.append(" SET ").append(key).append(" = ?");
                isFirst = false;
            } else {
                wildcardString.append(", ").append(key).append(" = ?");
            }

            paramList.add(needUpdateJsonObject.get(key));
        }

        sql.append("UPDATE ").append(getName()).append(wildcardString).append(" WHERE ").append(JdbcRepositories.getDefaultKeyName()).append(" = ?");
        paramList.add(id);
    }
354068
def _add_task(self, *args, **kwargs):
        
        task_id = kwargs['task_id']
        status = kwargs['status']
        runnable = kwargs['runnable']
        task = self._scheduled_tasks.get(task_id)
        if task:
            self._add_task_history.append((task, status, runnable))
            kwargs['owners'] = task._owner_list()

        if task_id in self._batch_running_tasks:
            for batch_task in self._batch_running_tasks.pop(task_id):
                self._add_task_history.append((batch_task, status, True))

        if task and kwargs.get('params'):
            kwargs['param_visibilities'] = task._get_param_visibilities()

        self._scheduler.add_task(*args, **kwargs)

        logger.info('Informed scheduler that task   %s   has status   %s', task_id, status)
1338269
def add(self, documents, boost=None):
        

        if not isinstance(documents, list):
            documents = [documents]
        documents = [{'doc': d} for d in documents]
        if boost:
            for d in documents:
                d['boost'] = boost

        self._add_batch.extend(documents)

        if len(self._add_batch) > SOLR_ADD_BATCH:
            self._addFlushBatch()
1277457
def prepare_batch(self, batch: mx.io.DataBatch):
        
        self.module.prepare(batch)
575008
public void add(List<BatchCSVRecord> record) {
        if (records == null)
            records = new ArrayList<>();
        records.add(record);
    }
89070
def _addFlushBatch(self):
        

        if len(self._add_batch) > 0:
            language_batches = {}
            # Create command JSONs for each of language endpoints
            for lang in self.endpoints:
                # Append documents with languages without endpoint to default endpoint
                document_jsons = ["\"add\":" + json.dumps(data) for data in self._add_batch
                                  if data['doc'].get("language", self.default_endpoint) == lang or (lang == self.default_endpoint and not self.endpoints.has_key(data['doc'].get("language", None)))]
                command_json = "{" + ",".join(document_jsons) + "}"
                language_batches[lang] = command_json
            # Solr requires for documents to be sent in { "add" : { "doc" : {...} }, "add": { "doc" : { ... }, ... }
            # format which isn't possible with python dictionaries
            for lang in language_batches:
                self._send_solr_command(self.endpoints[lang], language_batches[lang])
                self._add_batch = []
593029
def build_batch(cls, size, **kwargs):
        
        return [cls.build(**kwargs) for _ in range(size)]
666302
def _batch_insert(self, inserts, intervals, **kwargs):
    '''
    
    '''
    for timestamp,names in inserts.iteritems():
      for name,values in names.iteritems():
        for value in values:
          self._insert( name, value, timestamp, intervals, **kwargs )
580043
public function add(Batch ...$batches)
    {
        foreach ($batches as $batch) {
            if (!$this->has($batch)) {
                $this->batches[] = $batch;
            }
        }

        return $this;
    }