Pre process a MultiDataSet

@param toPreProcess the data set to pre process
422481
@Override
    public void preProcess(@NonNull MultiDataSet toPreProcess) {
        int numFeatures = toPreProcess.numFeatureArrays();
        int numLabels = toPreProcess.numLabelsArrays();

        for (int i = 0; i < numFeatures; i++) {
            strategy.preProcess(toPreProcess.getFeatures(i), toPreProcess.getFeaturesMaskArray(i), getFeatureStats(i));
        }
        if (isFitLabel()) {
            for (int i = 0; i < numLabels; i++) {
                strategy.preProcess(toPreProcess.getLabels(i), toPreProcess.getLabelsMaskArray(i), getLabelStats(i));
            }
        }
    }
435092
public void doProcess(Instance carrier)	{
		try {
			if(prePipe!=null)
				prePipe.addThruPipe(carrier);
			carrier.setSource(carrier.getData());
			featurePipe.addThruPipe(carrier);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
58242
def process(self, context, data):
        
        context.target_backend = self.requester_mapping[data.requester]
        return super().process(context, data)
1043835
public static <T, R> void processObject(R r, T src) {
        processObject(r, src, (r1, src1) -> {
        });
    }
1201754
private void processPredecessors() throws SQLException
   {
      List<Row> rows = getRows("select * from " + m_schema + "taskpred where proj_id=? and delete_date is null", m_projectID);
      m_reader.processPredecessors(rows);
   }
89269
private void removeDataPullUpperBounds() {
    log.info("Removing data pull upper bound for last work unit");
    Iterator<Predicate> it = predicateList.iterator();
    while (it.hasNext()) {
      Predicate predicate = it.next();
      if (predicate.getType() == Predicate.PredicateType.HWM) {
        log.info("Remove predicate: " + predicate.condition);
        it.remove();
      }
    }
  }
1297146
def _convert_results(self, data, **kwargs):
        

        if kwargs.get("multiprocessing", False):
            m = mp.Manager()
            output = m.Queue()
            pdb.set_trace()
            # processes = [mp.Process(target=convert_row_main,
            #                         args=(row, output,))
            #              for row in data]
            # # Run processes
            # for p in processes:
            #     p.start()

            # # Exit the completed processes
            # for p in processes:
            #     p.join()
            # # Get process results from the output queue
            # return [output.get() for p in processes]

            pool = mp.Pool(processes=pool_size)
            for i, row in enumerate(data):
                for key, val in row.items():
                    try:
                        pool.apply(convert_row_main, args=(val, i, key, output,))
                    except:
                        pass #
            # run = [pool.apply(convert_row_main, args=(row, i, output))
            #        for i, row in enumerate(data)]
            for item in output:
                pdb.set_trace()
            return output
            # with multiprocessing.Pool(processes=pool_size) as pool:
            #     results = [convert_row_main, (row,))
            #                for row in data]
            #     converted = [r.get() for r in results]
            # return converted #pool_outputs
        else:
            return [{key:pyrdf(value) for key, value in row.items()}
                    for row in data]
1167317
@Override public void process(MPPReader reader, ProjectFile file, DirectoryEntry root) throws MPXJException, IOException
   {
      try
      {
         populateMemberData(reader, file, root);
         processProjectProperties();

         if (!reader.getReadPropertiesOnly())
         {
            processCalendarData();
            processResourceData();
            processTaskData();
            processConstraintData();
            processAssignmentData();

            if (reader.getReadPresentationData())
            {
               processViewPropertyData();
               processViewData();
               processTableData();
            }
         }
      }

      finally
      {
         clearMemberData();
      }
   }
837842
protected function handleDataPreProcessor($source, $targetType, $currentPropertyPath)
    {
        if ($this->serviceFactory->has(ServiceInterface::SERVICE_DATA_PRE_PROCESSOR)) {
            /** @var DataPreProcessorService $dataProcessorService */
            $dataProcessorService = $this->serviceFactory->get(ServiceInterface::SERVICE_DATA_PRE_PROCESSOR);

            $processor = $dataProcessorService->getDataPreProcessor($source, $targetType);
            $source = $processor->getData();
            $processorResult = $processor->getResult();

            if ($processorResult->hasErrors()) {
                $this->messages->forProperty(implode('.', $currentPropertyPath))->merge($processorResult);
            }
        }

        return $source;
    }
717246
@Override
    public void startOfProcess() {
        String previousBaseIndent = baseIndent.substring(INDENT_LENGTH);
        builder.append(previousBaseIndent).append("HierarchyWrapper{\n");
        processFirstOtherContent = true;
    }
651672
def _process_with_multiprocessing(self, X: Union[pd.DataFrame, np.ndarray], n_refs: int, cluster_array: np.ndarray):
        
        with ProcessPoolExecutor(max_workers=self.n_jobs) as executor:

            jobs = [executor.submit(self._calculate_gap, X, n_refs, n_clusters)
                    for n_clusters in cluster_array
                    ]

            for future in as_completed(jobs):
                gap_value, k = future.result()
                yield (gap_value, k)
839361
@Override
  public final void process(final Map<String, Object> pReqVars,
    final IRequestData pRequestData) throws Exception {
    DatabaseInfo databaseInfo = getSrvOrm()
      .retrieveEntityWithConditions(pReqVars, DatabaseInfo.class, "");
    pRequestData.setAttribute("databaseInfo", databaseInfo);
    pRequestData.setAttribute("appVersion", getSrvOrm().getMngSettings()
      .getAppSettings().get("appVersion"));
  }
460479
public boolean doProcessing(List<JCCompilationUnit> roots,
                                List<ClassSymbol> classSymbols,
                                Iterable<? extends PackageSymbol> pckSymbols,
                                Log.DeferredDiagnosticHandler deferredDiagnosticHandler) {
        final Set<JCCompilationUnit> treesToClean =
                Collections.newSetFromMap(new IdentityHashMap<JCCompilationUnit, Boolean>());

        //fill already attributed implicit trees:
        for (Env<AttrContext> env : enter.getEnvs()) {
            treesToClean.add(env.toplevel);
        }

        Set<PackageSymbol> specifiedPackages = new LinkedHashSet<>();
        for (PackageSymbol psym : pckSymbols)
            specifiedPackages.add(psym);
        this.specifiedPackages = Collections.unmodifiableSet(specifiedPackages);

        Round round = new Round(roots, classSymbols, treesToClean, deferredDiagnosticHandler);

        boolean errorStatus;
        boolean moreToDo;
        do {
            // Run processors for round n
            round.run(false, false);

            // Processors for round n have run to completion.
            // Check for errors and whether there is more work to do.
            errorStatus = round.unrecoverableError();
            moreToDo = moreToDo();

            round.showDiagnostics(errorStatus || showResolveErrors);

            // Set up next round.
            // Copy mutable collections returned from filer.
            round = round.next(
                    new LinkedHashSet<>(filer.getGeneratedSourceFileObjects()),
                    new LinkedHashMap<>(filer.getGeneratedClasses()));

             // Check for errors during setup.
            if (round.unrecoverableError())
                errorStatus = true;

        } while (moreToDo && !errorStatus);

        // run last round
        round.run(true, errorStatus);
        round.showDiagnostics(true);

        filer.warnIfUnclosedFiles();
        warnIfUnmatchedOptions();

        /*
         * If an annotation processor raises an error in a round,
         * that round runs to completion and one last round occurs.
         * The last round may also occur because no more source or
         * class files have been generated.  Therefore, if an error
         * was raised on either of the last *two* rounds, the compile
         * should exit with a nonzero exit code.  The current value of
         * errorStatus holds whether or not an error was raised on the
         * second to last round; errorRaised() gives the error status
         * of the last round.
         */
        if (messager.errorRaised()
                || werror && round.warningCount() > 0 && round.errorCount() > 0)
            errorStatus = true;

        Set<JavaFileObject> newSourceFiles =
                new LinkedHashSet<>(filer.getGeneratedSourceFileObjects());
        roots = round.roots;

        errorStatus = errorStatus || (compiler.errorCount() > 0);

        round.finalCompiler();

        if (newSourceFiles.size() > 0)
            roots = roots.appendList(compiler.parseFiles(newSourceFiles));

        errorStatus = errorStatus || (compiler.errorCount() > 0);

        // Free resources
        this.close();

        if (errorStatus && compiler.errorCount() == 0) {
            compiler.log.nerrors++;
        }

        compiler.enterTreesIfNeeded(roots);

        if (!taskListener.isEmpty())
            taskListener.finished(new TaskEvent(TaskEvent.Kind.ANNOTATION_PROCESSING));

        return true;
    }
811079
def pre_process(self):
        
        LOGGER.info('ANALYSIS : Pre processing')

        for pre_processor in self._preprocessors:
            layer = pre_processor['process']['function'](self)
            purpose = pre_processor['output'].get('value')['key']
            save_style = pre_processor['output'].get('save_style', False)
            result, name = self.datastore.add_layer(layer, purpose, save_style)
            if not result:
                raise Exception(
                    tr('Something went wrong with the datastore : '
                       '{error_message}').format(error_message=name))
            layer = self.datastore.layer(name)
            self._preprocessors_layers[purpose] = layer
            self.debug_layer(layer, add_to_datastore=False)

            self.set_state_process('pre_processor', pre_processor['name'])
            LOGGER.info('{name} : Running'.format(name=pre_processor['name']))
132402
private void processPredecessor(Task task, MapRow row)
   {
      Task predecessor = m_taskMap.get(row.getUUID("PREDECESSOR_UUID"));
      if (predecessor != null)
      {
         task.addPredecessor(predecessor, row.getRelationType("RELATION_TYPE"), row.getDuration("LAG"));
      }
   }
501544
public static void processTopicID(final BuildData buildData, final ITopicNode topicNode, final Document doc) {
        final BaseTopicWrapper<?> topic = topicNode.getTopic();

        // Ignore info topics
        if (!topic.hasTag(buildData.getServerEntities().getInfoTagId())) {
            // Get the id value
            final String errorXRefID = ((SpecNode) topicNode).getUniqueLinkId(buildData.isUseFixedUrls());

            // Set the id
            setDOMElementId(buildData.getDocBookVersion(), doc.getDocumentElement(), errorXRefID);
        }

        // Add the remap parameter
        final Integer topicId = topicNode.getDBId();
        doc.getDocumentElement().setAttribute("remap", "TID_" + topicId);
    }
1042593
@Override
  protected void preprocess() {
    final Logging log = getLogger(); // Could be subclass
    createStorage();

    ArrayDBIDs ids = DBIDUtil.ensureArray(relation.getDBIDs());

    if(log.isStatistics()) {
      log.statistics(new LongStatistic(this.getClass().getName() + ".k", k));
    }
    Duration duration = log.isStatistics() ? log.newDuration(this.getClass().getName() + ".precomputation-time").begin() : null;
    FiniteProgress progress = getLogger().isVerbose() ? new FiniteProgress("Materializing k nearest neighbors (k=" + k + ")", ids.size(), getLogger()) : null;
    // Try bulk
    List<? extends KNNList> kNNList = null;
    if(usebulk) {
      kNNList = knnQuery.getKNNForBulkDBIDs(ids, k);
      if(kNNList != null) {
        int i = 0;
        for(DBIDIter id = ids.iter(); id.valid(); id.advance(), i++) {
          storage.put(id, kNNList.get(i));
          log.incrementProcessed(progress);
        }
      }
    }
    else {
      final boolean ismetric = getDistanceQuery().getDistanceFunction().isMetric();
      for(DBIDIter iter = ids.iter(); iter.valid(); iter.advance()) {
        if(ismetric && storage.get(iter) != null) {
          log.incrementProcessed(progress);
          continue; // Previously computed (duplicate point?)
        }
        KNNList knn = knnQuery.getKNNForDBID(iter, k);
        storage.put(iter, knn);
        if(ismetric) {
          for(DoubleDBIDListIter it = knn.iter(); it.valid() && it.doubleValue() == 0.; it.advance()) {
            storage.put(it, knn); // Reuse
          }
        }
        log.incrementProcessed(progress);
      }
    }
    log.ensureCompleted(progress);
    if(duration != null) {
      log.statistics(duration.end());
    }
  }