Enhance from metadata.

@param batch
the Event Batch
@return the Event Batch
162797
public EventBatch enhanceFromMetadata(final EventBatch<AuditEvent> batch) {
        for (AuditEvent event : batch) {
            enhanceFromMetadata((AuditEvent)event);
        }
        return batch;
    }
133066
public Batchlet<Step<T>> getOrCreateBatchlet()
   {
      Node node = childNode.getOrCreate("batchlet");
      Batchlet<Step<T>> batchlet = new BatchletImpl<Step<T>>(this, "batchlet", childNode, node);
      return batchlet;
   }
1347647
public List<T> getMore() {

        assert m_itemIndex < m_items.size();
        List<T> result = new ArrayList<T>();
        int totalSize = 0;
        while ((m_itemIndex < m_items.size()) && (totalSize < m_batchSize)) {
            T item = m_items.get(m_itemIndex);
            result.add(item);
            m_itemIndex += 1;
            totalSize += item.getSize();
        }
        return result;
    }
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;
    }
200557
@Override
  public Object put(List<Map.Entry> batch) throws InterruptedException {
    if (initializeClusterSource()) {
      return clusterSource.put(batch);
    }
    return null;
  }
803721
public function updateBinaryBatch(
        $batchId, Api\MtBatchBinarySmsUpdate $batch
    ) {
        $json = Serialize::binaryBatchUpdate($batch);
        $result = $this->_post($this->_batchUrl($batchId), $json);
        return Deserialize::batchResponse($result);
    }
1149585
public BatchResult addBatch(ApplicationDefinition appDef, String shardName, OlapBatch batch) {
        Utils.require(shardName.equals(MONO_SHARD_NAME), "Shard name must be: " + MONO_SHARD_NAME);
        return OLAPService.instance().addBatch(appDef, shardName, batch);
    }
822143
protected function batchCanConvert(Batch $batch)
    {
        return ($this->schema->hasConverter($batch->getAttribute()) && !$batch->isTypeRemoveAll());
    }
324880
private function buildBatchResponse($batch, $response) {
        $result = [];
        $responseBody = json_decode($response->raw_body, true);
        foreach ($batch as $collection => $events) {
            $eventResults = [];
            $eventResponses = $responseBody[$collection];
            foreach($events as $index => $event) {
                $eventResponse = $eventResponses[$index];
                $eventResult = new Response($eventResponse['success'], $eventResponse['duplicate'], null, $eventResponse['message'], $event);
                array_push($eventResults, $eventResult);
            }
            $result[$collection] = $eventResults;
        }

        $statusCode = $response->code;
        $errorMessage = $response->body->errorMessage;

        return new ResponseBatch($statusCode, $errorMessage, $result);
    }
588847
private CompletableFuture<Iterator<T>> batch() {
    return batch.thenCompose(iterator -> {
      if (iterator != null && !iterator.hasNext()) {
        batch = fetch(iterator.position());
        return batch.thenApply(Function.identity());
      }
      return CompletableFuture.completedFuture(iterator);
    });
  }
1061394
def _batchify(self, batch_data, batch_label, start=0):
        """"""
        i = start
        batch_size = self.batch_size
        try:
            while i < batch_size:
                label, s = self.next_sample()
                data = self.imdecode(s)
                try:
                    self.check_valid_image(data)
                except RuntimeError as e:
                    logging.debug('Invalid image, skipping:  %s', str(e))
                    continue
                data = self.augmentation_transform(data)
                assert i < batch_size, 'Batch size must be multiples of augmenter output length'
                batch_data[i] = self.postprocess_data(data)
                batch_label[i] = label
                i += 1
        except StopIteration:
            if not i:
                raise StopIteration
        return i
986923
public static byte[] enhanceModel(byte[] byteCode, ClassLoader... loaders) throws IOException,
        CannotCompileException {
        return enhanceModel(byteCode, new Version("1.0.0"), loaders);
    }
418666
public JSONObject batch(List<JSONObject> actions) throws AlgoliaException {
    return postBatch(actions, RequestOptions.empty);
  }
227565
function renderBatch(batch) {
  // Localize batch info
  var description = batch.nodeName,
      value = batch.value,
      childNodes = batch.childNodes,
      fns;

  // If there are no children, we are on a leaf
  if (!childNodes) {
    // If the value is an array, run all of them in series
    if (Array.isArray(value)) {
      fns = value;
      // TODO: Conditionally require a callback
      it(description, function handleMultipleIts (done) {
        // Iterate the functions in order
        var that = this;
        async.forEachSeries(fns, function (fn, cb) {
          // Clear the timeout
          that.runnable().resetTimeout();

          // If the function is async, pass it a callback
          if (fn.length) {
            fn.call(that, cb);
          } else{
          // Otherwise, run it and call the callback
            fn.call(that);
            cb(null);
          }
        }, done);
      });
    } else {
    // Otherwise, describe and execute `it`
      it(description, value);
    }
  } else {
  // Otherwise, we are on a parent node
    // Describe this context
    describe(description, function execRecursiveRender () {
      // If there is a value, act on it
      if (value) {
        // If the value is not an object, upcast them to an object
        var valObj = value;
        if (typeof value !== 'object' || Array.isArray(value)) {
          valObj = {before: value};
        }

        // Run all the hooks that exist
        // DEV: In all cases, `mocha` will handle the async and sync timings =3
        if (valObj.before) { addHooks(before, valObj.before); }
        if (valObj.beforeEach) { addHooks(beforeEach, valObj.beforeEach); }
        if (valObj.afterEach) { addHooks(afterEach, valObj.afterEach); }
        if (valObj.after) { addHooks(after, valObj.after); }
      }

      // Execute each of the children
      childNodes.forEach(renderBatch, this);
    });
  }
}
132216
public JSONObject batch(JSONArray actions, RequestOptions requestOptions) throws AlgoliaException {
    return postBatch(actions, requestOptions);
  }
469535
def _batchify(self, batch_data, batch_label, start=0):
        """"""
        i = start
        batch_size = self.batch_size
        try:
            while i < batch_size:
                label, s = self.next_sample()
                data = self.imdecode(s)
                try:
                    self.check_valid_image([data])
                    label = self._parse_label(label)
                    data, label = self.augmentation_transform(data, label)
                    self._check_valid_label(label)
                except RuntimeError as e:
                    logging.debug('Invalid image, skipping:  %s', str(e))
                    continue
                for datum in [data]:
                    assert i < batch_size, 'Batch size must be multiples of augmenter output length'
                    batch_data[i] = self.postprocess_data(datum)
                    num_object = label.shape[0]
                    batch_label[i][0:num_object] = nd.array(label)
                    if num_object < batch_label[i].shape[0]:
                        batch_label[i][num_object:] = -1
                    i += 1
        except StopIteration:
            if not i:
                raise StopIteration

        return i
791299
private void batchFileButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_batchFileButtonActionPerformed
        // Load a batch file
        JFileChooser fileChooser = new JFileChooser();
        if (fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
            File file = fileChooser.getSelectedFile();
            try (BufferedReader in = new BufferedReader(
                    new InputStreamReader(
                        new FileInputStream(file), "UTF8"))) {
                String str;

                sequenceArea.setText("");

                while ((str = in.readLine()) != null) {
                    sequenceArea.setText(sequenceArea.getText() + str + '\n');
                }
            } catch (UnsupportedEncodingException e) {
                System.out.println("Encoding exception");
            } catch (IOException e) {
                System.out.println("Cannot read from file" + fileChooser.getSelectedFile().toString());
            } catch (Exception e) {
                System.out.println("Exception");
            }

        }
    }