Attempts to run each given scenario once, in the current VM. Returns a set of all of the
scenarios that didn't throw a {@link SkipThisScenarioException}.
422694
ImmutableSet<Experiment> dryRun(Iterable<Experiment> experiments)
      throws InvalidBenchmarkException {
    ImmutableSet.Builder<Experiment> builder = ImmutableSet.builder();
    for (Experiment experiment : experiments) {
      Class<?> clazz = benchmarkClass.benchmarkClass();
      try {
        Object benchmark = injector.createChildInjector(ExperimentModule.forExperiment(experiment))
            .getInstance(Key.get(clazz));
        benchmarkClass.setUpBenchmark(benchmark);
        try {
          experiment.instrumentation().dryRun(benchmark);
          builder.add(experiment);
        } finally {
          // discard 'benchmark' now; the worker will have to instantiate its own anyway
          benchmarkClass.cleanup(benchmark);
        }
      } catch (ProvisionException e) {
        Throwable cause = e.getCause();
        if (cause != null) {
          throw new UserCodeException(cause);
        }
        throw e;
      } catch (CreationException e) {
        // Guice formatting is a little ugly
        StringBuilder message = new StringBuilder(
            "Could not create an instance of the benchmark class following reasons:");
        int errorNum = 0;
        for (Message guiceMessage : e.getErrorMessages()) {
          message.append("\n  ").append(++errorNum).append(") ")
              .append(guiceMessage.getMessage());
        }
        throw new InvalidBenchmarkException(message.toString(), e);
      } catch (SkipThisScenarioException innocuous) {}
    }
    return builder.build();
  }
1113606
public SnapshotSchedule withNextInvocations(java.util.Collection<java.util.Date> nextInvocations) {
        setNextInvocations(nextInvocations);
        return this;
    }
481203
public java.util.List<CancelledSpotInstanceRequest> getCancelledSpotInstanceRequests() {
        if (cancelledSpotInstanceRequests == null) {
            cancelledSpotInstanceRequests = new com.amazonaws.internal.SdkInternalList<CancelledSpotInstanceRequest>();
        }
        return cancelledSpotInstanceRequests;
    }
649032
def all(self):
        
        if self._scenario_name:
            scenarios = self._filter_for_scenario()
            self._verify()

            return scenarios

        scenarios = [c.scenario for c in self._configs]
        scenarios.sort(key=lambda x: x.directory)
        return scenarios
1060025
def _filter_for_scenario(self):
        
        return [
            c.scenario for c in self._configs
            if c.scenario.name == self._scenario_name
        ]
423804
public Versioned<E> previous() {
        if(hasPrevious()) {
            E resultValue = _previousNode.getValue().getValue();
            _lastId = _previousNode.getValue().getId();
            _lastCall = LastCall.PREVIOUS;
            _nextNode = _previousNode;
            _isNextSet = true;
            _isPreviousSet = false;
            return new Versioned<E>(resultValue, _previousNode.getVersion());
        } else {
            throw new NoSuchElementException();
        }
    }
460981
private void callNextForInternalReasons() throws CloudSpannerSQLException {
    if (!nextCalledForInternalReasons) {
      try {
        nextCalledForInternalReasonsResult = resultSet.next();
      } catch (SpannerException e) {
        throw new CloudSpannerSQLException(e);
      }
      nextCalledForInternalReasons = true;
    }
  }
753946
public void waitUntilNoMoreException(final Runnable runnable, final List<Class<? extends Exception>> expectedExceptions) {

        final List<RuntimeException> actualExceptions = new ArrayList<>();
        int tries = 0;
        while (tries < maxTries) {
            try {
                runnable.run();
                return;
            } catch (final RuntimeException ex) {
                if (!Utils4J.expectedException(ex, expectedExceptions) && !Utils4J.expectedCause(ex, expectedExceptions)) {
                    throw ex;
                }
                actualExceptions.add(ex);
                tries++;
                Utils4J.sleep(sleepMillis);
            }
        }
        throw new IllegalStateException("Waited too long for execution without exception. Expected exceptions: " + expectedExceptions
                + ", Actual exceptions: " + actualExceptions);

    }
476219
public Set<GraphObject> run()
	{
		for (GraphObject go : new HashSet<GraphObject>(result))
		{
			if (go instanceof Node)
			{
				checkNodeRecursive((Node) go);
			}
		}
		return result;
	}
681958
public java.util.List<InstanceState> getInstanceStates() {
        if (instanceStates == null) {
            instanceStates = new com.amazonaws.internal.SdkInternalList<InstanceState>();
        }
        return instanceStates;
    }
319372
public void addScenario(Class<? extends Scenario> scenarioClass,
            String scenarioID, String initialState, Properties properties,
            String gatewayDeviceID, String externalLinkID)
            throws ShanksException {
        // throws NonGatewayDeviceException, TooManyConnectionException,
        // DuplicatedIDException, AlreadyConnectedScenarioException,
        // SecurityException, NoSuchMethodException, IllegalArgumentException,
        // InstantiationException, IllegalAccessException,
        // InvocationTargetException {
        Constructor<? extends Scenario> c;
        Scenario scenario;
        try {
            c = scenarioClass.getConstructor(new Class[] { String.class,
                    String.class, Properties.class, Logger.class });
            scenario = c.newInstance(scenarioID, initialState, properties, this.getLogger());
        } catch (SecurityException e) {
            throw new ShanksException(e);
        } catch (NoSuchMethodException e) {
            throw new ShanksException(e);
        } catch (IllegalArgumentException e) {
            throw new ShanksException(e);
        } catch (InstantiationException e) {
            throw new ShanksException(e);
        } catch (IllegalAccessException e) {
            throw new ShanksException(e);
        } catch (InvocationTargetException e) {
            throw new ShanksException(e);
        }

        Device gateway = (Device) scenario.getNetworkElement(gatewayDeviceID);
        Link externalLink = (Link) this.getNetworkElement(externalLinkID);
        if (!scenario.getCurrentElements().containsKey(gatewayDeviceID)) {
            throw new NonGatewayDeviceException(scenario, gateway, externalLink);
        } else {
            gateway.connectToLink(externalLink);
            if (!this.getCurrentElements().containsKey(externalLink.getID())) {
                this.addNetworkElement(externalLink);
            }
            if (!this.scenarios.containsKey(scenario)) {
                this.scenarios.put(scenario, new ArrayList<Link>());
            } else {
                List<Link> externalLinks = this.scenarios.get(scenario);
                if (!externalLinks.contains(externalLink)) {
                    externalLinks.add(externalLink);
                } else if (externalLink.getLinkedDevices().contains(gateway)) {
                    throw new AlreadyConnectedScenarioException(scenario,
                            gateway, externalLink);
                }
            }
        }
    }
733826
@Benchmark
  @BenchmarkMode(Mode.SampleTime)
  @OutputTimeUnit(TimeUnit.NANOSECONDS)
  public void manyRunnables() throws Exception {
    incrRunnable.val = 0;
    for (int i = 0; i < 500; i++) {
      executor.execute(incrRunnable);
    }
    executor.execute(phaserRunnable);
    phaser.arriveAndAwaitAdvance();
    if (incrRunnable.val != 500) {
      throw new AssertionError();
    }
  }
217239
@Before()
    public void beforeScenario(Scenario scenario) {
        getContext().setHar(HarContext.getInstance().getServer().newHar(scenario.getName()));
    }
1003726
public SequencalJobExecuteResults runAll() {
        SequencalJobExecuteResults results = new SequencalJobExecuteResults();
        for (Job job : jobs) {
            job.setJarByClass(SequencalJobChain.class);
            try {
                boolean isSuccessful = job.waitForCompletion(true);
                results.add(new SequencalJobExecuteResult(isSuccessful, job.getJobName()));
                if (!isSuccessful) {
                    break;
                }
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }
        return results;
    }
1192543
public RetryerBuilder<V> retryIfRuntimeException() {
        rejectionPredicate = Predicates.or(rejectionPredicate, new ExceptionClassPredicate<V>(RuntimeException.class));
        return this;
    }
603134
public weka.core.Instances wekaInstances(Instances instances) {
        weka.core.Instances wekaInstances = wekaInstancesInformation(instances);
        //We assume that we have only one WekaInstanceInformation for SamoaToWekaInstanceConverter
        this.wekaInstanceInformation = wekaInstances;
        for (int i = 0; i < instances.numInstances(); i++) {
            wekaInstances.add(wekaInstance(instances.instance(i)));
        }
        return wekaInstances;
    }
653794
def instances(self, skip_exist_test=False):
        
        self.reset_result_type()
        self._instances = True
        self._instances_skip_exist_test = skip_exist_test
        return self