Executes findAll with the given {@link Rollout} {@link Specification}s.
773378
private Page<JpaRollout> findByCriteriaAPI(final Pageable pageable,
            final List<Specification<JpaRollout>> specList) {
        if (CollectionUtils.isEmpty(specList)) {
            return rolloutRepository.findAll(pageable);
        }

        return rolloutRepository.findAll(SpecificationsBuilder.combineWithAnd(specList), pageable);
    }
22385
public void execute() throws MojoExecutionException, MojoFailureException {
        if (skip) {
            getLog().info("Not executing specifications.");
        } else {
            prepareReportsDir();
            prepareRunnerExecutors();
            printBanner();
            try {
                runAllTests();
            } finally {
                printFooter();
                for (TestResultsIndex testResultsIndex : testResultsIndexes.values()) {
                    testResultsIndex.dump();
                }
            }
            checkTestsResults();
        }
    }
315360
public Iterable<HibernateConfigurationFileModel> findAllByApplication(final ProjectModel application)
    {
        List<HibernateConfigurationFileModel> results = new ArrayList<>();

        for (HibernateConfigurationFileModel model : findAll())
        {
            Set<ProjectModel> modelApplications = ProjectTraversalCache.getApplicationsForProject(getGraphContext(), model.getProjectModel());
            if (modelApplications.contains(application))
                results.add(model);
        }
        return results;
    }
303939
private CompositeExecutionContext addAll(List<ExecutionContext> contexts) {
        this.elements = new ImmutableList.Builder().addAll(contexts).build();
        return this;
    }
876813
public @NotNull <T> List<T> findAll(@NotNull Class<T> cl, @NotNull @SQL String sql, Object... args) {
        return findAll(cl, SqlQuery.query(sql, args));
    }
350209
def run_rollouts(
    env, agent, initial_observations, step_limit=None, discount_factor=1.0,
    log_every_steps=None, video_writers=(), color_bar=False,
    many_rollouts_from_each_env=False
):
  """"""
  assert step_limit is not None or not many_rollouts_from_each_env, (
      "When collecting many rollouts from each environment, time limit must "
      "be set."
  )

  num_dones = 0
  first_dones = np.array([False] * env.batch_size)
  observations = initial_observations
  step_index = 0
  cum_rewards = np.zeros(env.batch_size)

  for (video_writer, obs_stack) in zip(video_writers, initial_observations):
    for (i, ob) in enumerate(obs_stack):
      debug_frame = augment_observation(
          ob, reward=0, cum_reward=0, frame_index=(-len(obs_stack) + i + 1),
          bar_color=((0, 255, 0) if color_bar else None)
      )
      video_writer.write(debug_frame)

  def proceed():
    if step_index < step_limit:
      return num_dones < env.batch_size or many_rollouts_from_each_env
    else:
      return False

  while proceed():
    act_kwargs = {}
    if agent.needs_env_state:
      act_kwargs["env_state"] = env.state
    actions = agent.act(observations, **act_kwargs)
    (observations, rewards, dones) = env.step(actions)
    observations = list(observations)
    now_done_indices = []
    for (i, done) in enumerate(dones):
      if done and (not first_dones[i] or many_rollouts_from_each_env):
        now_done_indices.append(i)
        first_dones[i] = True
        num_dones += 1
    if now_done_indices:
      # Unless many_rollouts_from_each_env, reset only envs done the first time
      # in this timestep to ensure that we collect exactly 1 rollout from each
      # env.
      reset_observations = env.reset(now_done_indices)
      for (i, observation) in zip(now_done_indices, reset_observations):
        observations[i] = observation
    observations = np.array(observations)
    cum_rewards[~first_dones] = (
        cum_rewards[~first_dones] * discount_factor + rewards[~first_dones]
    )
    step_index += 1

    for (video_writer, obs_stack, reward, cum_reward, done) in zip(
        video_writers, observations, rewards, cum_rewards, first_dones
    ):
      if done:
        continue
      ob = obs_stack[-1]
      debug_frame = augment_observation(
          ob, reward=reward, cum_reward=cum_reward,
          frame_index=step_index, bar_color=((255, 0, 0) if color_bar else None)
      )
      video_writer.write(debug_frame)

    # TODO(afrozm): Clean this up with tf.logging.log_every_n
    if log_every_steps is not None and step_index % log_every_steps == 0:
      tf.logging.info("Step %d, mean_score: %f", step_index, cum_rewards.mean())

  return (observations, cum_rewards)
618885
@SuppressWarnings("unchecked")
	protected void executeOnCollections(List<IN> inputData, RuntimeContext ctx, ExecutionConfig executionConfig) throws Exception {
		OutputFormat<IN> format = this.formatWrapper.getUserCodeObject();
		TypeInformation<IN> inputType = getInput().getOperatorInfo().getOutputType();

		if (this.localOrdering != null) {
			int[] sortColumns = this.localOrdering.getFieldPositions();
			boolean[] sortOrderings = this.localOrdering.getFieldSortDirections();

			final TypeComparator<IN> sortComparator;
			if (inputType instanceof CompositeType) {
				sortComparator = ((CompositeType<IN>) inputType).createComparator(sortColumns, sortOrderings, 0, executionConfig);
			} else if (inputType instanceof AtomicType) {
				sortComparator = ((AtomicType<IN>) inputType).createComparator(sortOrderings[0], executionConfig);
			} else {
				throw new UnsupportedOperationException("Local output sorting does not support type "+inputType+" yet.");
			}

			Collections.sort(inputData, new Comparator<IN>() {
				@Override
				public int compare(IN o1, IN o2) {
					return sortComparator.compare(o1, o2);
				}
			});
		}

		if(format instanceof InitializeOnMaster) {
			((InitializeOnMaster)format).initializeGlobal(1);
		}
		format.configure(this.parameters);

		if(format instanceof RichOutputFormat){
			((RichOutputFormat<?>) format).setRuntimeContext(ctx);
		}
		format.open(0, 1);
		for (IN element : inputData) {
			format.writeRecord(element);
		}
		
		format.close();
		
		if(format instanceof FinalizeOnMaster) {
			((FinalizeOnMaster)format).finalizeGlobal(1);
		}
	}
1232370
public <T> List<T> executeExtractList(final Class<T> clazz, final Object value) throws DevFailed {
        final Object r = command.executeExtract(value);
        return extractList(TypeConversionUtil.castToType(clazz, r));
    }
1303019
public <T> List<T> executeExtractList(final Class<T> clazz, final Object... value) throws DevFailed {
        final Object result = command.executeExtract(value);
        return extractList(TypeConversionUtil.castToArray(clazz, result));
    }
439277
@Override
  public Collection<FastFuture<T>> getAllResults() {
    results.addAll(active);
    active.clear();
    return results;
  }
88519
@Transactional(readOnly = true)
	public Collection<Response> findAll() {
		return em.createQuery("FROM Response", Response.class).getResultList();
	}
1255997
protected void runAllStepsInLoop(List<GherkinConditionedLoopedStep> loopedSteps) throws TechnicalException {
        for (final GherkinConditionedLoopedStep loopedStep : loopedSteps) {
            final List<GherkinStepCondition> stepConditions = new ArrayList<>();
            final String[] expecteds = loopedStep.getExpected().split(";");
            final String[] actuals = loopedStep.getActual().split(";");
            if (actuals.length != expecteds.length) {
                throw new TechnicalException(Messages.getMessage(TechnicalException.TECHNICAL_EXPECTED_ACTUAL_SIZE_DIFFERENT));
            }
            for (int i = 0; i < expecteds.length; i++) {
                stepConditions.add(new GherkinStepCondition(loopedStep.getKey(), expecteds[i], actuals[i]));
            }
            boolean found = false;
            for (final Entry<String, Method> elem : Context.getCucumberMethods().entrySet()) {
                final Matcher matcher = Pattern.compile("value=(.*)\\)").matcher(elem.getKey());
                if (matcher.find()) {
                    final Matcher matcher2 = Pattern.compile(matcher.group(1)).matcher(loopedStep.getStep());
                    if (matcher2.find()) {
                        Object[] tab;
                        if (elem.getValue().isAnnotationPresent(Conditioned.class)) {
                            tab = new Object[matcher2.groupCount() + 1];
                            tab[matcher2.groupCount()] = stepConditions;
                        } else {
                            tab = new Object[matcher2.groupCount()];
                        }

                        for (int i = 0; i < matcher2.groupCount(); i++) {
                            final Parameter param = elem.getValue().getParameters()[i];
                            if (param.getType() == int.class) {
                                final int ii = Integer.parseInt(matcher2.group(i + 1));
                                tab[i] = ii;
                            } else if (param.getType() == boolean.class) {
                                tab[i] = Boolean.parseBoolean(matcher2.group(i + 1));
                            } else {
                                tab[i] = matcher2.group(i + 1);
                            }
                        }
                        try {
                            found = true;
                            elem.getValue().invoke(NoraUiInjector.getNoraUiInjectorSource().getInstance(elem.getValue().getDeclaringClass()), tab);
                            break;
                        } catch (final Exception e) {
                            throw new TechnicalException("\"" + loopedStep.getStep() + "\"", e.getCause());
                        }
                    }
                }
            }
            if (!found) {
                throw new TechnicalException(String.format(Messages.getMessage(TechnicalException.TECHNICAL_ERROR_STEP_UNDEFINED), loopedStep.getStep()));
            }
        }
    }
1208246
public static void mergeReports(File reportOverall, File... reports) {
    SessionInfoStore infoStore = new SessionInfoStore();
    ExecutionDataStore dataStore = new ExecutionDataStore();
    boolean isCurrentVersionFormat = loadSourceFiles(infoStore, dataStore, reports);

    try (BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(reportOverall))) {
      Object visitor;
      if (isCurrentVersionFormat) {
        visitor = new ExecutionDataWriter(outputStream);
      } else {
        visitor = new org.jacoco.previous.core.data.ExecutionDataWriter(outputStream);
      }
      infoStore.accept((ISessionInfoVisitor) visitor);
      dataStore.accept((IExecutionDataVisitor) visitor);
    } catch (IOException e) {
      throw new IllegalStateException(String.format("Unable to write overall coverage report %s", reportOverall.getAbsolutePath()), e);
    }
  }
529433
public void execute() throws MojoExecutionException, MojoFailureException {
        // iterate through all <merge />
        for (Merger merger : mergers) {
            // get target file name...
            final File target = merger.getTarget();
            // get list of source files
            final List<File> sources = Arrays.asList(merger.getSources());
            // ...and use a stream
            final OutputStream targetStream = initOutput(target);
            // iterate source files
            for (File source : sources) {
                final InputStream sourceStream = initInput(source);
                // append
                appendStream(sourceStream, targetStream);
                // close source
                if (null != sourceStream) {
                    try {
                        sourceStream.close();
                    } catch (IOException e) {
                        throw new MojoExecutionException(
                            "Could not close file: "
                                + source.getAbsolutePath(), e);
                    }
                }
            }
            // close target
            if (null != targetStream) {
                try {
                    targetStream.close();
                } catch (IOException e) {
                    throw new MojoExecutionException("Could not close file: "
                        + target.getAbsolutePath(), e);
                }
            }
        }
    }
230884
public CoverageBuilder analyzeFiles(ExecutionDataStore executionDataStore, Collection<File> classFiles) {
    CoverageBuilder coverageBuilder = new CoverageBuilder();
    if (useCurrentBinaryFormat) {
      Analyzer analyzer = new Analyzer(executionDataStore, coverageBuilder);
      for (File classFile : classFiles) {
        analyzeClassFile(analyzer, classFile);
      }
    } else {
      org.jacoco.previous.core.analysis.Analyzer analyzer = new org.jacoco.previous.core.analysis.Analyzer(executionDataStore, coverageBuilder);
      for (File classFile : classFiles) {
        analyzeClassFile(analyzer, classFile);
      }
    }
    return coverageBuilder;
  }
1048610
public static void printAllJobs(List<JobExecutionInfo> jobExecutionInfos, int resultsLimit) {
        if (jobExecutionInfos == null) {
            System.err.println("No jobs found.");
            System.exit(1);
        }

        List<String> labels = Arrays.asList("Job Name", "State", "Last Run Started", "Last Run Completed",
                "Schedule", "Last Run Records Processed", "Last Run Records Failed");
        List<String> flags = Arrays.asList("-", "-", "-", "-", "-", "", "");
        List<List<String>> data = new ArrayList<>();
        for (JobExecutionInfo jobInfo : jobExecutionInfos) {
            List<String> entry = new ArrayList<>();
            entry.add(jobInfo.getJobName());
            entry.add(jobInfo.getState().toString());
            entry.add(dateTimeFormatter.print(jobInfo.getStartTime()));
            entry.add(dateTimeFormatter.print(jobInfo.getEndTime()));

            entry.add(extractJobSchedule(jobInfo));

            // Add metrics
            MetricArray metrics = jobInfo.getMetrics();
            Double recordsProcessed = null;
            Double recordsFailed = null;
            try {
                for (Metric metric : metrics) {
                    if (metric.getName().equals(MetricNames.ExtractorMetrics.RECORDS_READ_METER)) {
                        recordsProcessed = Double.parseDouble(metric.getValue());
                    } else if (metric.getName().equals(MetricNames.ExtractorMetrics.RECORDS_FAILED_METER)) {
                        recordsFailed = Double.parseDouble(metric.getValue());
                    }
                }

                if (recordsProcessed != null && recordsFailed != null) {
                    entry.add(recordsProcessed.toString());
                    entry.add(recordsFailed.toString());
                }
            } catch (NumberFormatException ex) {
                System.err.println("Failed to process metrics");
            }
            if (recordsProcessed == null || recordsFailed == null) {
                entry.add("-");
                entry.add("-");
            }

            data.add(entry);
        }
        new CliTablePrinter.Builder()
                .labels(labels)
                .data(data)
                .flags(flags)
                .delimiterWidth(2)
                .build()
                .printTable();

        if (jobExecutionInfos.size() == resultsLimit) {
            System.out.println("\nWARNING: There may be more jobs (# of results is equal to the limit)");
        }
    }
718559
def get_all(self, qry, tpl):
        '''  '''
        self.cur.execute(qry, tpl)
        result = self.cur.fetchall()
        return result